Hello,
I have a build that I run. When it's done, the reports that it generates are outputted to a specific directory (say ~/builds/output/reports.) What I'd like to do is attach the files inside to an individual build in Bamboo.
This is what I've tried so far.
I tried a relative and an absolute path, no go. What am I doing wrong?
The goal here is to have a single place where this information is kept so that other members of my group can look at them.
Hello Andrew,
Thank you for your question.
Please, refer to Configuring a job's build artifacts for further information.
Alternatively, if you want to use a location that is outside your build working directory, you could to the following:
# lets use the following as build working directory /atlassian/bamboo-home/xml-data/build-dir/PROJ-PLAN-JOB1 # you have a file in /atlassian/foo/bar.txt you want to use as artifact, then configure the location as per following: Location: ../../../../foo Copy pattern: bar.txt
If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.
Thank you for your understanding.
—
Kind regards,
Rafael P. Sperafico
Atlassian Support
Would it make more sense to just have a script that copies the generated files to the build area after the build is run?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Andrew, Thank you for your question. The is no problem on creating an Script /SCP task in order to copy files from one place to another. There issue in here is that only you will know what will be happening, Bamboo will not have knowledge of the artifact generated nor the one to be used. You will be the one managing the copying files. If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired. Thank you for your understanding. — Kind regards, Rafael P. Sperafico Atlassian Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Rafael, This is the new issue that I have: bash: /opt/automated_testing/copy_report.sh: No such file or directory Which I consider to be bizarre, since I can run other scripts out of automated_testing and the script is in fact located there. As for only me knowing this, after I'm done, this will all go into the local wiki on the topic, so that others will know and it's ok if Bamboo is not cognizant of every step.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Andrew, Please, make sure the file is located under "/opt/automated_testing/copy_report.sh" and start with something simple just to make sure your script is being located by Bamboo. After that, start to build up the script you want. ============ #!/bin/sh echo "hello, world" ============ Are you adding this "copy_report.sh" to a Script task or are you adding it as a Command Capability to the Bamboo agent is running this build? Please, refer to the following for further information: * https://confluence.atlassian.com/display/BAMBOO/Script * https://confluence.atlassian.com/display/BAMBOO/Custom+command+executable Please, make sure you the script is located under the same agent box where the build is running from. If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired. Thank you for your understanding. — Kind regards, Rafael P. Sperafico Atlassian Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Rafael, This is interesting. I have two jobs. Both of them are running scripts. However, when I ran the command pwd in the first one, it retrieved the path that's found on the target execution machine (where the test is supposed to run.) When I ran the command pwd in the second one, it retrieved the path that's found on the server that controls the Bamboo jobs! In this case, of course that it can't run the copy instruction that I wanted to run! What could possibly cause this? And how do I change it back?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Andrew, Thank you for your question. A Bamboo job is a single build unit within a plan. One or more jobs can be organised into one or more stages. The jobs in a stage can all be run at the same time, if enough Bamboo agents are available. A job is made up of one or more tasks. Every job has its own build working directory and this is not something you can change or configure. Please, refer to https://confluence.atlassian.com/display/BAMBOO/Jobs+and+tasks for further information. If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired. Thank you for your understanding. — Kind regards, Rafael P. Sperafico Atlassian Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Andrew,
Thank you for your question.
Based on the description you have provided, it seems you are not giving the correct location to where your generated files are located in the build directory.
When running a build in Bamboo, files will be created under the build directory (In case check the build directory by opening up your build log, second line):
simple 19-Dec-2014 14:53:25 Build Project - Plan - Default Job #1 (PROJ-PLAN-JOB1-1) started building on agent Default Agent simple 19-Dec-2014 14:53:25 Build working directory is <bamboo-home>/xml-data/build-dir/PROJ-PLAN-JOB1
When creating an artifact, Bamboo will start looking in the build working directory. Please, refer to Locating important directories and files for further information.
Lets take the following example:
Create a Project/Plan and add a Script task as per following:
# Windows md foo echo "foo-bar" > foo/bar.txt
# Linux mkdir foo echo "foo-bar" > foo/bar.txt
As a result, I would have the following in the build working directory:
<bamboo-home>/xml-data/build-dir/PROJ-PLAN-JOB1/foo/bar.txt
In order to generate the Artifact using "bar.txt", you should proceed as per following:
Name: <name-of-your-choice> Location: foo Copy pattern: bar.txt [x] Shared
The next time you run this build, the Artifact above will be available under the "Build Summary" and "Artifacts" tab.
Please, refer to Sharing artifacts for further information.
If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.
Thank you for your understanding.
—
Kind regards,
Rafael P. Sperafico
Atlassian Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, thanks for such a quick reply. One quick question, does the location (in your example "foo") matter if it's an absolute one? Say /home/user/build/version/stuff?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.