From 8e153c0b5312fd2ae4fb471c98eeadb129a50d17 Mon Sep 17 00:00:00 2001 From: Alastair Smith Date: Tue, 5 Mar 2019 14:27:46 -0600 Subject: [PATCH] add temporary Jenkinsfile - Jenkinsfile only contains branch logic and comments - docker commands will be activated once beta-stage service has been added to docs swarm stack --- Jenkinsfile | 105 +++++++++++++++++++++++++++------------------------- 1 file changed, 54 insertions(+), 51 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 34916fbce7..7d20b55ab9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,81 +9,84 @@ pipeline { timeout(time: 1, unit: 'HOURS') } stages { - stage( 'docker.github.io' ) { + stage( 'docs-private' ) { agent { label 'ubuntu-1604-aufs-stable' } + when { + expression { env.GIT_URL == 'https://github.com/docker/docs-private.git' } + } stages { - stage( 'build and push stage image' ) { + stage( 'build and push new beta-stage image' ) { when { - branch 'master' + branch 'amberjack' } steps { - withDockerRegistry(reg) { - sh """ - docker image build --tag docs/docker.github.io:stage-${env.BUILD_NUMBER} . && \ - docker image push docs/docker.github.io:stage-${env.BUILD_NUMBER} - """ - } + sh 'echo "Build and push new beta-stage image here"' + // withDockerRegistry(reg) { + // sh """ + // docker image build --tag docs/docs-private:beta-stage-${env.BUILD_NUMBER} . && \ + // docker image push docs/docs-private:beta-stage-${env.BUILD_NUMBER} + // """ + // } } } - stage( 'build and push prod image' ) { + stage( 'build and push new beta image' ) { when { branch 'published' } steps { - withDockerRegistry(reg) { - sh """ - docker image build --tag docs/docker.github.io:prod-${env.BUILD_NUMBER} . && \ - docker image push docs/docker.github.io:prod-${env.BUILD_NUMBER} - """ - } + sh 'echo "Build and push new beta image here"' + // withDockerRegistry(reg) { + // sh """ + // docker image build --tag docs/docs-private:beta-${env.BUILD_NUMBER} . && \ + // docker image push docs/docs-private:beta-${env.BUILD_NUMBER} + // """ + // } } } - stage( 'update docs-stage' ) { + stage( 'update beta-stage service' ) { when { - branch 'master' + branch 'amberjack' } steps { - withVpn(dtrVpnAddress) { - withCredentials(ucpBundle) { - sh 'unzip -o $UCP' - } - withDockerRegistry(reg) { - sh """ - export DOCKER_TLS_VERIFY=1 - export COMPOSE_TLS_VERSION=TLSv1_2 - export DOCKER_CERT_PATH=${WORKSPACE}/ucp-bundle-success_bot - export DOCKER_HOST=tcp://ucp.corp-us-east-1.aws.dckr.io:443 - docker service update --detach=false --force --image docs/docker.github.io:stage-${env.BUILD_NUMBER} docs-stage-docker-com_docs --with-registry-auth - """ - } - } + sh 'echo "Update beta-stage service here"' + // withVpn(dtrVpnAddress) { + // withCredentials(ucpBundle) { + // sh 'unzip -o $UCP' + // } + // withDockerRegistry(reg) { + // sh """ + // export DOCKER_TLS_VERIFY=1 + // export COMPOSE_TLS_VERSION=TLSv1_2 + // export DOCKER_CERT_PATH=${WORKSPACE}/ucp-bundle-success_bot + // export DOCKER_HOST=tcp://ucp.corp-us-east-1.aws.dckr.io:443 + // docker service update --detach=false --force --image docs/docs-private:build-${env.BUILD_NUMBER} docs-beta-docker-com_docs --with-registry-auth + // """ + // } + // } } } - stage( 'update docs-prod' ) { + stage( 'update beta service' ) { when { branch 'published' } steps { - withVpn(dtrVpnAddress) { - withCredentials(ucpBundle) { - sh 'unzip -o $UCP' - } - withCredentials(slackString) { - withDockerRegistry(reg) { - sh """ - cd ucp-bundle-success_bot - export DOCKER_TLS_VERIFY=1 - export COMPOSE_TLS_VERSION=TLSv1_2 - export DOCKER_CERT_PATH=${WORKSPACE}/ucp-bundle-success_bot - export DOCKER_HOST=tcp://ucp.corp-us-east-1.aws.dckr.io:443 - docker service update --detach=false --force --image docs/docker.github.io:prod-${env.BUILD_NUMBER} docs-docker-com_docs --with-registry-auth - curl -X POST -H 'Content-type: application/json' --data '{"text":"Successfully published docs. https://docs.docker.com/"}' $slack - """ - } - } - } + sh 'echo "Update beta service here"' + // withVpn(dtrVpnAddress) { + // withCredentials(ucpBundle) { + // sh 'unzip -o $UCP' + // } + // withDockerRegistry(reg) { + // sh """ + // export DOCKER_TLS_VERIFY=1 + // export COMPOSE_TLS_VERSION=TLSv1_2 + // export DOCKER_CERT_PATH=${WORKSPACE}/ucp-bundle-success_bot + // export DOCKER_HOST=tcp://ucp.corp-us-east-1.aws.dckr.io:443 + // docker service update --detach=false --force --image docs/docs-private:build-${env.BUILD_NUMBER} docs-beta-docker-com_docs --with-registry-auth + // """ + // } + // } } } }