Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is it possible to specify a repository without it being checked out?

Craig February 1, 2012

My environment:

I have a build with multiple stages. Only the first stage requires the source repository (it does the build). After that artifacts are used to share the build output with the other stages.

My assumptions/understanding:

1. If a source repository is specified (i.e. Use Plan's Repository) then it will check out all the source.

2. Without a source repository the revision number variable isn't set (${bamboo.repository.revision.number})

My problem:

In my final stage I want to copy the artifact files to a folder that has the revision number in its name. However to use the revision number I seem to need to have the repository set, which then checks out the source, even though I don't need it.

My thoughts/questions:

Is there some way the revision is accessible across the whole plan?

Is it possible to specify a repository without it being checked out?

4 answers

1 accepted

0 votes
Answer accepted
Craig February 6, 2012

I took the approach suggested by Renjith V [NSN], and after a bit of tinkering with powershell was able to use the contents of a file from stage 1 as arguments in stage 3.

0 votes
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 1, 2012

You should be able to artifact in the first stage itself using the version number also and then in the third stage copy the artifact from 1st stage to 3rd stage. Feasible?

http://confluence.atlassian.com/display/BAMBOO/Configuring+Artifact+Sharing+between+Jobs

Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 1, 2012

Oh! Guess that may not be directly possible, but I am not sure. A simple workaround will be to touch a file with the version number in stage 1, make that an artifact and pass that artifact to stage 3, and it will contain the version number.

Craig February 1, 2012

This is what I am doing and it is working as far as making the artifacts available in stage 3.

However what I want to do in stage 3 is use the version number as a variable in a command task, and at the moment doing so results in dummyVcsKey. The reason I do this in stage 3 is I only want to run the command if the tests (stage 2) have succeeded.

Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 1, 2012

You can't put it into a variable. But, if you use a script task instead of a command task, you can pretty easily read the artifact content into a script variable (well, at least on Unix) and pass it to a command you want to run.

0 votes
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 1, 2012

But without getting the repository checked out how are you able to get the artifact files, are they not dependent on the files coming from the source files?

0 votes
Craig February 1, 2012

I only need repository checked out for the first stage, but these tasks are in the third stage where they use the artifact generated by the first stage.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events