Pipeline Usage
Any command that you wrap with the cloudshareDockerMachine
DSL extension runs on a CloudShare VM, instead of locally:
cloudshareDockerMachine { // docker commands }
For example, in the following pipeline script, the docker-compose
command will run against a dedicated CloudShare docker-machine, and not on the Jenkins host itself:
node { stage('build') { git 'https://github.com/cloudshare/express-ws-chat.git' cloudshareDockerMachine { sh 'docker-compose -p ${JOB_NAME} build' } } }
If you want to modify the name of the CloudShare environment that's created for the project, you can specify:
cloudShareDockerMachine(name: 'my-environment') { // docker stuff }
Outside the scope of the cloudshareDockerMachine
step, any docker command would run against the local Docker daemon.
Comments
0 comments
Article is closed for comments.