blob: 230960593281a1cfaeda0b7544a59e0c3616d00a [file] [log] [blame]
Matteo Scandoloe7425c52017-08-14 17:49:31 -07001// Copyright 2017-present Open Networking Foundation
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
Zack Williamsce63eb02017-02-28 10:46:22 -070014
15stage('checkout') {
16 node('master'){
17 checkout(changelog: false, poll: false, scm: [$class: 'RepoScm', \
18 manifestRepositoryUrl: 'https://gerrit.opencord.org/manifest.git', \
19 manifestBranch: 'master', currentBranch: true, \
20 manifestFile: 'default.xml', \
21 destinationDir: 'cord', \
22 forceSync: true, resetFirst: true, \
23 quiet: false, jobs: 4, showAllChanges: true])
24 }
25}
26
27stage('imagebuilder'){
28 node('master') {
Zack Williamsf13b7762018-03-22 10:35:53 -070029 sh '$WORKSPACE/imagebuilder.py -v -r cord/ -c cord/docker_images.yml -l image_logs -a ib_actions.yml -g ib_graph.dot'
Zack Williamsce63eb02017-02-28 10:46:22 -070030 }
31}
32
33stage('push'){
34 node('master'){
35 def ib_actions = readYaml( file:"$WORKSPACE/ib_actions.yml" )
36
37 withDockerRegistry([credentialsId: 'docker-artifact-push-credentials']) {
38 for(image in ib_actions.ib_built){
Zack Williams9b7c80b2018-03-20 15:07:58 -070039 for(tag in image.tags){
Zack Williamsf13b7762018-03-22 10:35:53 -070040 push_tag = image.base + ":" + tag
41 echo "Pushing image: " + push_tag
42 docker.image(push_tag).push()
Zack Williams9b7c80b2018-03-20 15:07:58 -070043 }
Zack Williamsce63eb02017-02-28 10:46:22 -070044 }
45 }
46 }
47}
48
49echo "All done"