Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Commit

Permalink
Update jenkins file
Browse files Browse the repository at this point in the history
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
  • Loading branch information
silvin-lubecki committed Jan 16, 2019
1 parent 64b3c0c commit c88673c
Showing 1 changed file with 115 additions and 64 deletions.
179 changes: 115 additions & 64 deletions Jenkinsfile.baguette
Original file line number Diff line number Diff line change
Expand Up @@ -8,64 +8,77 @@ pipeline {
options {
skipDefaultCheckout(true)
}
environment{
DOCKER_BUILDKIT=true
}

stages {
stage('Build') {
agent {
label 'team-local && linux'
}
steps {
dir('src/github.com/docker/app') {
script {
try {
checkout scm
sh 'make -f docker.Makefile lint'
sh 'make -f docker.Makefile cross e2e-cross tars'
dir('bin') {
stash name: 'binaries'
}
dir('e2e') {
stash name: 'e2e'
}
dir('examples') {
stash name: 'examples'
}
if(!(env.BRANCH_NAME ==~ "PR-\\d+")) {
stash name: 'artifacts', includes: 'bin/*.tar.gz', excludes: 'bin/*-e2e-*'
archiveArtifacts 'bin/*.tar.gz'
parallel {
stage('Binaries'){
agent {
label 'team-local && linux'
}
steps {
dir('src/github.com/docker/app') {
script {
try {
checkout scm
sh 'make -f docker.Makefile lint'
sh 'make -f docker.Makefile cross e2e-cross tars'
dir('bin') {
stash name: 'binaries'
}
dir('e2e') {
stash name: 'e2e'
}
dir('examples') {
stash name: 'examples'
}
if(!(env.BRANCH_NAME ==~ "PR-\\d+")) {
stash name: 'artifacts', includes: 'bin/*.tar.gz', excludes: 'bin/*-e2e-*'
}
archiveArtifacts 'bin/*.tar.gz'
} finally {
def clean_images = /docker image ls --format "{{.ID}}\t{{.Tag}}" | grep $(git describe --always --dirty) | awk '{print $1}' | xargs docker image rm -f/
sh clean_images
}
}
} finally {
def clean_images = /docker image ls --format "{{.ID}}\t{{.Tag}}" | grep $(git describe --always --dirty) | awk '{print $1}' | xargs docker image rm -f/
sh clean_images
}
}
}
}
post {
always {
deleteDir()
}
}
}
stage('Test') {
parallel {
stage("Coverage") {
environment {
CODECOV_TOKEN = credentials('jenkins-codecov-token')
post {
always {
deleteDir()
}
}
}
stage('Invocation image'){
agent {
label 'team-local && linux'
}
steps {
dir('src/github.com/docker/app') {
checkout scm
sh 'make -f docker.Makefile coverage'
archiveArtifacts '_build/ci-cov/all.out'
archiveArtifacts '_build/ci-cov/coverage.html'
sh 'curl -s https://codecov.io/bash | bash -s - -f _build/ci-cov/all.out -K'
sh 'make -f docker.Makefile save-invocation-image'
}
dir('/tmp') {
stash name: 'invocation-image', includes: 'invocation-image-*.tar'
archiveArtifacts 'invocation-image-*.tar'
}
dir('src/github.com/docker/app') {
sh 'make -f docker.Makefile clean-invocation-image'
}
}
post {
always {
deleteDir()
}
}
}
}
}
stage('Test') {
parallel {
stage("Gradle test") {
agent {
label 'team-local && linux'
Expand All @@ -84,11 +97,16 @@ pipeline {
agent {
label 'team-local && linux'
}
environment {
DOCKERAPP_BINARY = '../docker-app-linux'
}
environment {
DOCKERAPP_BINARY = '../docker-app-linux'
}
steps {
dir('/tmp') {
unstash "invocation-image"
}
dir('src/github.com/docker/app') {
checkout scm
sh 'make -f docker.Makefile load-invocation-image'
unstash "binaries"
dir('examples') {
unstash "examples"
Expand All @@ -109,11 +127,16 @@ pipeline {
agent {
label 'team-local && mac'
}
environment {
DOCKERAPP_BINARY = '../docker-app-darwin'
}
environment {
DOCKERAPP_BINARY = '../docker-app-darwin'
}
steps {
dir('/tmp') {
unstash "invocation-image"
}
dir('src/github.com/docker/app') {
checkout scm
sh 'make -f docker.Makefile load-invocation-image'
unstash "binaries"
dir('examples') {
unstash "examples"
Expand All @@ -134,11 +157,16 @@ pipeline {
agent {
label 'team-local && windows && linux-containers'
}
environment {
DOCKERAPP_BINARY = '../docker-app-windows.exe'
}
environment {
DOCKERAPP_BINARY = '../docker-app-windows.exe'
}
steps {
dir('/tmp') {
unstash "invocation-image"
}
dir('src/github.com/docker/app') {
checkout scm
bat 'make -f docker.Makefile load-invocation-image'
unstash "binaries"
dir('examples') {
unstash "examples"
Expand All @@ -158,24 +186,47 @@ pipeline {
}
}
stage('Release') {
agent {
label 'team-local && linux'
}
when {
buildingTag()
}
steps {
dir('src/github.com/docker/app') {
unstash 'artifacts'
echo "Releasing $TAG_NAME"
dir('bin') {
release('docker/app')
parallel {
stage('Push invocation image'){
agent {
label 'team-local && linux'
}
environment {
DOCKERHUB_CREDS=credentials('dockerhub-dockerdsgcibot')
}
steps{
sh 'docker login --username "${DOCKERHUB_CREDS_USR}" --password "${DOCKERHUB_CREDS_PSW}"'
dir('/tmp') {
unstash "invocation-image"
}
dir('src/github.com/docker/app') {
checkout scm
sh 'make -f docker.Makefile load-invocation-image'
sh 'make -f docker.Makefile push-invocation-image'
}
}
}
}
post {
always {
deleteDir()
stage('Release Github binaries') {
agent {
label 'team-local && linux'
}
steps {
dir('src/github.com/docker/app') {
unstash 'artifacts'
echo "Releasing $TAG_NAME"
dir('bin') {
release('docker/app-cnab')
}
}
}
post {
always {
deleteDir()
}
}
}
}
}
Expand Down

0 comments on commit c88673c

Please sign in to comment.