Andy Bavier | c517852 | 2018-12-12 15:36:30 -0700 | [diff] [blame] | 1 | /* voltha-publish pipeline */ |
| 2 | pipeline { |
| 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}", \ |
| 17 | currentBranch: true, \ |
| 18 | destinationDir: 'cord', \ |
| 19 | forceSync: true, |
| 20 | resetFirst: true, \ |
| 21 | quiet: true, \ |
| 22 | jobs: 4, \ |
| 23 | showAllChanges: true] \ |
| 24 | ) |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | stage('build'){ |
| 29 | steps { |
| 30 | sh """ |
| 31 | #!/usr/bin/env bash |
| 32 | |
| 33 | pushd cord/incubator/voltha |
| 34 | VOLTHA_BUILD=docker DOCKER_CACHE_ARG=--no-cache TAG=${params.manifestBranch} make build |
| 35 | |
| 36 | popd |
| 37 | """ |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | stage('push'){ |
| 42 | steps { |
| 43 | withDockerRegistry([credentialsId: 'docker-artifact-push-credentials', url: '']) { |
| 44 | sh """ |
| 45 | #!/usr/bin/env bash |
| 46 | |
| 47 | pushd cord/incubator/voltha |
| 48 | VOLTHA_BUILD=docker TAG=${params.manifestBranch} TARGET_REPOSITORY=voltha/ TARGET_TAG=${params.manifestBranch} make push |
| 49 | |
| 50 | popd |
| 51 | """ |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | post { |
| 58 | failure { |
| 59 | emailext ( |
| 60 | subject: "$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS", |
| 61 | body: "Check console output at $BUILD_URL to view the results.", |
| 62 | to: "${params.failureEmail}" |
| 63 | ) |
| 64 | } |
| 65 | } |
| 66 | } |