This article explains how to set isolation type for a Bamboo job using Bamboo Command Line Interface (CLI).
Instructions
Use the setJobIsolationOptions action to set job isolation type for a Bamboo job. Refer to the sample command below:
Code Block | ||
---|---|---|
| ||
--action setJobIsolationOptions --plan DEMO-ABC --job "ABC" --stage "Default Stage" --type DOCKER --docker Test --field hostDirectory_1=${bamboo.working.directory} --field containerDirectory_1=${bamboo.working.directory} --field hostDirectory_2=${bamboo.tmp.directory} --field containerDirectory_2=${bamboo.tmp.directory} |
In the above action:
- --plan value refers to a Bamboo plan key.
- --job value refers to the Bamboo job key.
- --stage value refers to a stage name.
- --type value refers to the isolation type.
- --docker value refers to a docker image name.
- --field parameter refers specific docker volume mappingsvalue refers to a host directory and content directory
- hostDirectory_1=${bamboo.working.directory} refers that bamboo working directory( directory where bamboo temporarily puts the checked-out files it is building) is mounted as first host directory data volume in docker container.
- .--field containerDirectory_1=${bamboo.working.directory} refers that bamboo working directory( directory where bamboo temporarily puts the checked-out files it is building) as first container directory data volume in docker container.
- .--field hostDirectory_2=${bamboo.tmp.directory} refers that bamboo tmp directory is mounted as second host directory data volume in docker container.
- .--field containerDirectory_2=${bamboo.tmp.directory} refers that bamboo tmp directory is mounted as second container directory data volume in docker container.
Info |
---|
It is recommended to test it in a non-production environment or run the action with --simulate parameter to verify the behavior before deploying. |
...