This seems like such a simple issue with an obvious fix, but I must be missing something. I'm executing a Command task whose job in life is to rename a file. Here's how I've defined it:
- Executable = /bin/mv
- Argument = *.tgz ${bamboo.appName}.tgz
- Environment Variables = <blank>
- Working Subdirectory = target/universal
Now here's my file system:
/WORKING_DIRECTORY
-- target
-- -- universal
-- -- -- myappname.tgz
But when I execute this, I get the following errors:
simple 14-Mar-2014 03:46:05 Starting task 'Rename artifact' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.command'
command 14-Mar-2014 03:46:05 Beginning to execute external process for build 'Aragorn - Test Plan - Download Commit and Build #17 (ARA-TEST-DS-17)'\n ... running command line: \n/bin/mv *.tgz aragorn.tgz\n ... in: /var/lib/bamboo/bamboo-home/xml-data/build-dir/ARA-TEST-DS/target/universal\n ... using extra environment variables: \nbamboo_appName=aragorn\n
error 14-Mar-2014 03:46:05 /bin/mv: cannot stat `*.tgz': No such file or directory
simple 14-Mar-2014 03:46:05 Failing task since return code of [/bin/mv *.tgz aragorn.tgz] was 1 while expected 0
The "cannot stat" error basically means the "mv" command can't find the file in the current directory.
But when I SSH into the server and manually go to /var/lib/bamboo/bamboo-home/xml-data/build-dir/ARA-TEST-DS/target/universal and then manually run "/bin/mv *.tgz aragorn.tgz" it works just fine.
Any ideas what's going on here?