github.com/simonferquel/app@v0.6.1-0.20181012141724-68b7cccf26ac/Jenkinsfile (about) 1 properties([buildDiscarder(logRotator(numToKeepStr: '20'))]) 2 3 pipeline { 4 agent { 5 label 'linux && x86_64' 6 } 7 8 options { 9 skipDefaultCheckout(true) 10 } 11 12 stages { 13 stage('Build') { 14 parallel { 15 stage("Validate") { 16 agent { 17 label 'ubuntu-1604-aufs-edge' 18 } 19 steps { 20 dir('src/github.com/docker/app') { 21 checkout scm 22 sh 'make -f docker.Makefile lint' 23 sh 'make -f docker.Makefile vendor' 24 } 25 } 26 } 27 stage("Binaries"){ 28 agent { 29 label 'ubuntu-1604-aufs-edge' 30 } 31 steps { 32 dir('src/github.com/docker/app') { 33 script { 34 try { 35 checkout scm 36 sh 'make -f docker.Makefile cross e2e-cross tars' 37 dir('bin') { 38 stash name: 'binaries' 39 } 40 dir('e2e') { 41 stash name: 'e2e' 42 } 43 dir('examples') { 44 stash name: 'examples' 45 } 46 if(!(env.BRANCH_NAME ==~ "PR-\\d+")) { 47 stash name: 'artifacts', includes: 'bin/*.tar.gz', excludes: 'bin/*-e2e-*' 48 archiveArtifacts 'bin/*.tar.gz' 49 } 50 } finally { 51 def clean_images = /docker image ls --format "{{.ID}}\t{{.Tag}}" | grep $(git describe --always --dirty) | awk '{print $1}' | xargs docker image rm -f/ 52 sh clean_images 53 } 54 } 55 } 56 } 57 post { 58 always { 59 deleteDir() 60 } 61 } 62 } 63 } 64 } 65 stage('Test') { 66 parallel { 67 stage("Coverage") { 68 agent { 69 label 'ubuntu-1604-aufs-edge' 70 } 71 steps { 72 dir('src/github.com/docker/app') { 73 checkout scm 74 sh 'make -f docker.Makefile coverage' 75 archiveArtifacts '_build/ci-cov/all.out' 76 archiveArtifacts '_build/ci-cov/coverage.html' 77 } 78 } 79 } 80 stage("Coverage (experimental)") { 81 agent { 82 label 'ubuntu-1604-aufs-edge' 83 } 84 steps { 85 dir('src/github.com/docker/app') { 86 checkout scm 87 sh 'make EXPERIMENTAL=on -f docker.Makefile coverage' 88 } 89 } 90 } 91 stage("Gradle test") { 92 agent { 93 label 'ubuntu-1604-aufs-edge' 94 } 95 steps { 96 dir('src/github.com/docker/app') { 97 checkout scm 98 dir("bin") { 99 unstash "binaries" 100 } 101 sh 'make -f docker.Makefile gradle-test' 102 } 103 } 104 post { 105 always { 106 deleteDir() 107 } 108 } 109 } 110 stage("Test Linux") { 111 agent { 112 label 'ubuntu-1604-aufs-edge' 113 } 114 environment { 115 DOCKERAPP_BINARY = '../docker-app-linux' 116 } 117 steps { 118 dir('src/github.com/docker/app') { 119 unstash "binaries" 120 dir('examples') { 121 unstash "examples" 122 } 123 dir('e2e'){ 124 unstash "e2e" 125 } 126 sh './docker-app-e2e-linux --e2e-path=e2e' 127 } 128 } 129 post { 130 always { 131 deleteDir() 132 } 133 } 134 } 135 } 136 } 137 } 138 }