| Mark Beierl | fda0ef0 | 2022-07-14 09:37:34 -0400 | [diff] [blame^] | 1 | /* Copyright ETSI OSM and others |
| beierl | 67001ad | 2019-08-29 14:21:35 -0400 | [diff] [blame] | 2 | * |
| 3 | * All Rights Reserved. |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 6 | * not use this file except in compliance with the License. You may obtain |
| 7 | * a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | * License for the specific language governing permissions and limitations |
| 15 | * under the License. |
| 16 | */ |
| 17 | |
| Mike Marchetti | 9f671c5 | 2018-03-22 14:52:08 -0400 | [diff] [blame] | 18 | properties([ |
| 19 | parameters([ |
| 20 | string(defaultValue: env.BRANCH_NAME, description: '', name: 'GERRIT_BRANCH'), |
| 21 | string(defaultValue: 'osm/devops', description: '', name: 'GERRIT_PROJECT'), |
| 22 | string(defaultValue: env.GERRIT_REFSPEC, description: '', name: 'GERRIT_REFSPEC'), |
| 23 | string(defaultValue: env.GERRIT_PATCHSET_REVISION, description: '', name: 'GERRIT_PATCHSET_REVISION'), |
| 24 | string(defaultValue: 'https://osm.etsi.org/gerrit', description: '', name: 'PROJECT_URL_PREFIX'), |
| 25 | booleanParam(defaultValue: false, description: '', name: 'TEST_INSTALL'), |
| 26 | string(defaultValue: 'artifactory-osm', description: '', name: 'ARTIFACTORY_SERVER'), |
| 27 | ]) |
| 28 | ]) |
| 29 | |
| 30 | def devops_checkout() { |
| 31 | dir('devops') { |
| 32 | git url: "${PROJECT_URL_PREFIX}/osm/devops", branch: params.GERRIT_BRANCH |
| beierl | 67001ad | 2019-08-29 14:21:35 -0400 | [diff] [blame] | 33 | sh "git fetch origin ${params.GERRIT_REFSPEC}" |
| 34 | if (params.GERRIT_PATCHSET_REVISION.size() > 0 ) { |
| 35 | sh "git checkout -f ${params.GERRIT_PATCHSET_REVISION}" |
| 36 | } |
| Mike Marchetti | 9f671c5 | 2018-03-22 14:52:08 -0400 | [diff] [blame] | 37 | } |
| 38 | } |
| 39 | |
| Mark Beierl | fda0ef0 | 2022-07-14 09:37:34 -0400 | [diff] [blame^] | 40 | node('stage_2') { |
| Mike Marchetti | 9f671c5 | 2018-03-22 14:52:08 -0400 | [diff] [blame] | 41 | checkout scm |
| 42 | devops_checkout() |
| 43 | |
| 44 | ci_stage_2 = load "devops/jenkins/ci-pipelines/ci_stage_2.groovy" |
| 45 | ci_stage_2.ci_pipeline( 'devops', |
| 46 | params.PROJECT_URL_PREFIX, |
| 47 | params.GERRIT_PROJECT, |
| 48 | params.GERRIT_BRANCH, |
| 49 | params.GERRIT_REFSPEC, |
| 50 | params.GERRIT_PATCHSET_REVISION, |
| 51 | params.TEST_INSTALL, |
| 52 | params.ARTIFACTORY_SERVER) |
| 53 | } |