I ultimately want automate my deployment process, using crons and by uploading the built artifacts to my server, which automatically registers these uploads and moves them where they need to go, so I can move them easily and efficiently.
The last {} (in the destination path, where I want the files to deploy to) causes issues. In Travis these files are usually in the path /home/travis/build/owner/repo/dist , so adding {} to the destination will create these directories as well. This is the problem.
The only solution I see fit is using xargs. The way you would do this with xargs would in my own opinion would be a parameter substitution. So in theory, in this bash script I’m going to write below for my example, this may give you a better scope when using cURL and CRON jobs in your .travis.yml file, and to understand the mechanism of action:
your_id=${USER}-on-${HOSTNAME}
echo "$your_id"
#
echo "Old \$PATH = $PATH"
PATH=${PATH}:/opt/bin # Add /opt/bin to $PATH for duration of script.
echo "New \$PATH = $PATH"
This would work, but I think for this luckily, there’s a simpler solution - xargs is the way to go. Try the following:
You can cd/pushd to the appropriate directory so that the paths are just files. E.g. in a subshell so that the current directory in the main shell is not affected: