-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
8.2.7, 9.2.1
-
None
-
Severity 3 - Minor
-
0
-
Issue Summary
This is reproducible on Data Center:
A Bamboo Docker Runner Job will not modify its working directory variable to follow a customised workdir volume mount point. This will create a series of issues as the standard /home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAN-KEY-JOB folder will not be created and Bamboo will still try to use it within the container and the build will fail.
Steps to Reproduce
- Create a Plan with a Job running on Docker Runner
- Modify the Job's volume options:
- From:
${bamboo.working.directory} >> ${bamboo.working.directory}
- To (example):
${bamboo.working.directory} >> /opt/src
- From:
- Add a Checkout task to the Plan
- Run the build
Expected Results
- The docker container mounts /opt/src
- Bamboo should use /opt/src as its ${bamboo.working.directory}
- The build should succeed
Actual Results
- Bamboo keeps the ${bamboo.working.directory} unchanged:
command 13-Mar-2023 10:24:14 Substituting variable: ${bamboo.working.directory} with /home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAN-KEY-JOB
- As Bamboo relies on the docker volume mount option to create any directories inside the container, the customised directory /opt/src is created inside the container but the Bamboo Agent application will still consider the default folder location /home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAN-KEY-JOB as its workdir instead of the customised volume. The build fails with Git not being able to access the workdir as it doesn't exist. That is also valid for any program that needs files in the workdir location.
Workaround
- Use only the default Job's ${bamboo.working.directory} mount point on the Job's Volume options
- As the first task of the Job, add a Script task that would create a symbolic link from Bamboo's workdir to the desired location:
$ ln -sf ${bamboo_working_directory} /opt/src
- Build the Plan normally, and make sure to cwd to the desired location before issuing any commands that depend on a hardcoded path
- mentioned in
-
Page Loading...
[BAM-22118] Bamboo Docker Runner Job will not substitute ${bamboo.working.directory} variable if that is customised as a mount volume option
UIS | Original: 2 | New: 0 |
UIS | Original: 0 | New: 2 |
UIS | Original: 3 | New: 0 |
UIS | Original: 0 | New: 3 |
UIS | Original: 1 | New: 0 |
UIS | New: 1 |
Remote Link | New: This issue links to "Page (Confluence)" [ 741010 ] |
Status | Original: Needs Triage [ 10030 ] | New: Long Term Backlog [ 12073 ] |
Description |
Original:
h3. Issue Summary
This is reproducible on Data Center: (/) A Bamboo Docker Runner Job will not modify its working directory variable to follow a customised workdir volume mount point. This will create a series of issues as the standard {{/home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAN-KEY-JOB}} folder will not be created and Bamboo will still try to use it within the container and the build will fail. h3. Steps to Reproduce # Create a Plan with a Job running on Docker Runner # Modify the Job's volume options: ** {*}From{*}: {noformat} ${bamboo.working.directory} >> ${bamboo.working.directory} {noformat} ** {*}To (example){*}: {noformat} ${bamboo.working.directory} >> /opt/src {noformat} # Add a Checkout task to the Plan # Run the build h3. Expected Results # The docker container mounts {{/opt/src}} # Bamboo should use {{/opt/src}} as its _${bamboo.working.directory}_ # The build should succeed h3. Actual Results # Bamboo keeps the _${bamboo.working.directory}_ unchanged: {noformat} command 13-Mar-2023 10:24:14 Substituting variable: ${bamboo.working.directory} with /home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAN-KEY-JOB{noformat} # As Bamboo relies on the docker volume mount option to create any directories inside the container, the customised directory *{{/opt/src}}* is created inside the container but the Bamboo Agent application will still consider the default folder location *{{/home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAN-KEY-JOB}}* as its workdir instead of the customised volume. The build fails with Git not being able to access the workdir as it doesn't exist. +That is also valid for any program that needs files in the workdir location.+ h3. Workaround # Use only the default Job's _${bamboo.working.directory}_ mount point on the Job's Volume options # As the first task of the Job, add a Script task that would create a symbolic link from Bamboo's workdir to the desired location: {noformat} $ ln -sf ${bamboo_working_directory} /opt/src{noformat} # Build the Plan normally, and make sure to _cwd_ to the desired location before issuing any commands that depend on a hardcoded path |
New:
h3. Issue Summary
This is reproducible on Data Center: (/) A Bamboo Docker Runner Job will not modify its working directory variable to follow a customised workdir volume mount point. This will create a series of issues as the standard {{/home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAN-KEY-JOB}} folder will not be created and Bamboo will still try to use it within the container and the build will fail. h3. Steps to Reproduce # Create a Plan with a Job running on Docker Runner # Modify the Job's volume options: ** {*}From{*}: {noformat} ${bamboo.working.directory} >> ${bamboo.working.directory} {noformat} ** {*}To (example){*}: {noformat} ${bamboo.working.directory} >> /opt/src {noformat} # Add a Checkout task to the Plan # Run the build h3. Expected Results # The docker container mounts {{/opt/src}} # Bamboo should use {{/opt/src}} as its _${bamboo.working.directory}_ # The build should succeed h3. Actual Results # Bamboo keeps the _${bamboo.working.directory}_ unchanged: {noformat} command 13-Mar-2023 10:24:14 Substituting variable: ${bamboo.working.directory} with /home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAN-KEY-JOB{noformat} # As Bamboo relies on the docker volume mount option to create any directories inside the container, the customised directory *{{/opt/src}}* is created inside the container but the Bamboo Agent application will still consider the default folder location *{{/home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAN-KEY-JOB}}* as its workdir instead of the customised volume. The build fails with Git not being able to access the workdir as it doesn't exist. +That is also valid for any program that needs files in the workdir location.+ h3. Workaround # Use only the default Job's _${bamboo.working.directory}_ mount point on the Job's Volume options # As the first task of the Job, add a Script task that would create a symbolic link from Bamboo's workdir to the desired location: {noformat} $ ln -sf ${bamboo_working_directory} /opt/src{noformat} # Build the Plan normally, and make sure to _cwd_ to the desired location before issuing any commands that depend on a hardcoded path |
Description |
Original:
h3. Issue Summary
This is reproducible on Data Center: (/) A Bamboo Docker Runner Job will not modify its working directory variable to follow a customised workdir volume mount point. This will create a series of issues as the standard {{/home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAN-KEY-JOB}} folder will not be created and Bamboo will still try to use it within the container and the build will fail. h3. Steps to Reproduce # Create a Plan with a Job running on Docker Runner # Modify the Job's volume options: ** {*}From{*}: {noformat} ${bamboo.working.directory} >> ${bamboo.working.directory} {noformat} ** {*}To (example){*}: {noformat} ${bamboo.working.directory} >> /opt/src {noformat} # Add a Checkout task to the Plan # Run the build h3. Expected Results # The docker container mounts {{/opt/src}} # Bamboo should use {{/opt/src}} as its _${bamboo.working.directory}_ # The build should succeed h3. Actual Results # Bamboo keeps the _${bamboo.working.directory}_ unchanged: {noformat} command 13-Mar-2023 10:24:14 Substituting variable: ${bamboo.working.directory} with /home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAN-KEY-JOB{noformat} # As Bamboo relies on the docker volume mount option to create any directories inside the container, the customised directory *{{/opt/src}}* is created inside the container but the Bamboo Agent application will still consider the default folder location *{{/home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAN-KEY-JOB}}* as its workdir instead of the customised volume. The build fails with Git not being able to access the workdir as it doesn't exist. +That is also valid for any program that needs files in the workdir location.+ h3. Workaround # Use only the default Job's _${bamboo.working.directory}_ mount point on the Job's Volume options # As the first task of the Job, add a Script task that would create a symbolic link from Bamboo's workdir to the desired location: {noformat} $ ln -s ${bamboo_working_directory} /opt/src{noformat} # Build the Plan normally, and make sure to _cwd_ to the desired location before issuing any commands that depend on a hardcoded path |
New:
h3. Issue Summary
This is reproducible on Data Center: (/) A Bamboo Docker Runner Job will not modify its working directory variable to follow a customised workdir volume mount point. This will create a series of issues as the standard {{/home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAN-KEY-JOB}} folder will not be created and Bamboo will still try to use it within the container and the build will fail. h3. Steps to Reproduce # Create a Plan with a Job running on Docker Runner # Modify the Job's volume options: ** {*}From{*}: {noformat} ${bamboo.working.directory} >> ${bamboo.working.directory} {noformat} ** {*}To (example){*}: {noformat} ${bamboo.working.directory} >> /opt/src {noformat} # Add a Checkout task to the Plan # Run the build h3. Expected Results # The docker container mounts {{/opt/src}} # Bamboo should use {{/opt/src}} as its _${bamboo.working.directory}_ # The build should succeed h3. Actual Results # Bamboo keeps the _${bamboo.working.directory}_ unchanged: {noformat} command 13-Mar-2023 10:24:14 Substituting variable: ${bamboo.working.directory} with /home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAN-KEY-JOB{noformat} # As Bamboo relies on the docker volume mount option to create any directories inside the container, the customised directory *{{/opt/src}}* is created inside the container but the Bamboo Agent application will still consider the default folder location *{{/home/bamboo/bamboo-agent-home/xml-data/build-dir/PLAN-KEY-JOB}}* as its workdir instead of the customised volume. The build fails with Git not being able to access the workdir as it doesn't exist. +That is also valid for any program that needs files in the workdir location.+ h3. Workaround # Use only the default Job's _${bamboo.working.directory}_ mount point on the Job's Volume options # As the first task of the Job, add a Script task that would create a symbolic link from Bamboo's workdir to the desired location: {noformat} $ ln -sf ${bamboo_working_directory} /opt/src{noformat} # Build the Plan normally, and make sure to _cwd_ to the desired location before issuing any commands that depend on a hardcoded path |