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}", \ |
Andy Bavier | da0d6ba | 2018-12-13 13:06:37 -0700 | [diff] [blame] | 17 | manifestGroup: 'voltha', \ |
Andy Bavier | c517852 | 2018-12-12 15:36:30 -0700 | [diff] [blame] | 18 | 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 Bavier | f159a20 | 2019-03-21 16:01:24 -0700 | [diff] [blame] | 35 | 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 Bavier | c517852 | 2018-12-12 15:36:30 -0700 | [diff] [blame] | 41 | 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 Bavier | f159a20 | 2019-03-21 16:01:24 -0700 | [diff] [blame] | 53 | 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 Bavier | c517852 | 2018-12-12 15:36:30 -0700 | [diff] [blame] | 59 | 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 | } |