blob: a07d4f2a52d75af9de774f238c8e39e00e106db1 [file] [log] [blame]
Andy Bavierc5178522018-12-12 15:36:30 -07001/* voltha-publish pipeline */
2pipeline {
3
4 /* no label, executor is determined by JJB */
5 agent {
6 label "${params.executorNode}"
7 }
8 stages {
9
10 stage('repo') {
11 steps {
12 checkout(changelog: false, \
13 poll: false,
14 scm: [$class: 'RepoScm', \
15 manifestRepositoryUrl: "${params.manifestUrl}", \
16 manifestBranch: "${params.manifestBranch}", \
Andy Bavierda0d6ba2018-12-13 13:06:37 -070017 manifestGroup: 'voltha', \
Andy Bavierc5178522018-12-12 15:36:30 -070018 currentBranch: true, \
19 destinationDir: 'cord', \
20 forceSync: true,
21 resetFirst: true, \
22 quiet: true, \
23 jobs: 4, \
24 showAllChanges: true] \
25 )
26 }
27 }
28
29 stage('build'){
30 steps {
31 sh """
32 #!/usr/bin/env bash
33
34 pushd cord/incubator/voltha
Andy Bavierf159a202019-03-21 16:01:24 -070035 if [ "${params.manifestBranch}" != "master" ]
36 then
37 VOLTHA_BUILD=docker DOCKER_CACHE_ARG=--no-cache TAG=${params.manifestBranch} make build
38 else
39 VOLTHA_BUILD=docker DOCKER_CACHE_ARG=--no-cache make build
40 fi
Andy Bavierc5178522018-12-12 15:36:30 -070041 popd
42 """
43 }
44 }
45
46 stage('push'){
47 steps {
48 withDockerRegistry([credentialsId: 'docker-artifact-push-credentials', url: '']) {
49 sh """
50 #!/usr/bin/env bash
51
52 pushd cord/incubator/voltha
Andy Bavierf159a202019-03-21 16:01:24 -070053 if [ "${params.manifestBranch}" != "master" ]
54 then
55 VOLTHA_BUILD=docker TAG=${params.manifestBranch} TARGET_REPOSITORY=voltha/ TARGET_TAG=${params.manifestBranch} make push
56 else
57 VOLTHA_BUILD=docker TARGET_REPOSITORY=voltha/ make push
58 fi
Andy Bavierc5178522018-12-12 15:36:30 -070059 popd
60 """
61 }
62 }
63 }
64 }
65
66 post {
67 failure {
68 emailext (
69 subject: "$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS",
70 body: "Check console output at $BUILD_URL to view the results.",
71 to: "${params.failureEmail}"
72 )
73 }
74 }
75}