Hi,
I'm automating the build of an android application with bamboo and I have trouble archiving the resulting .apk-files in a webserver directory.
The code is hosted in a bitbucket git repository with multiple branches which bamboo recognizes and builds different apks for each branch.
Once the build is complete the apk file should be copied to a webserver directory, so I added a script task with the following content:
dir="/var/www/android/${bamboo.repository.git.branch}/"
mkdir -p $dir
cp bin/appname.apk $dir/appname_b${bamboo.buildNumber}.apk
The result for build 45 in the branch "foo" should be a file in
/var/www/android/foo/appname_b45.apk
The problem is, that the file is copied to the same folder for all branches:
/var/www/android/master/appname_b45.apk
i.e. the variable pointing to the branch is always master and I would assume it should be foo in this case?
I stripped my configuration to the minimum:
- One Stage
- One Job
- One Task: Source Code Checkout from the default repository
- One Task: Script which just prints the variable to the logfile (with the same result)
Thanks,
Kai