| peusterm | 102d726 | 2018-10-01 16:25:44 +0200 | [diff] [blame] | 1 | // Copyright (c) 2018 by Paderborn University |
| 2 | // (manuel@peuster.de) |
| 3 | // ALL RIGHTS RESERVED. |
| 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | // you may not use this file except in compliance with the License. |
| 7 | // You may obtain 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, |
| 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | // See the License for the specific language governing permissions and |
| 15 | // limitations under the License. |
| 16 | // |
| 17 | // Neither the name of the OSM, Paderborn University |
| 18 | // nor the names of its contributors may be used to endorse or promote |
| 19 | // products derived from this software without specific prior written |
| 20 | // permission. |
| 21 | |
| peusterm | 396e91e | 2017-10-25 16:20:51 +0200 | [diff] [blame] | 22 | properties([ |
| 23 | parameters([ |
| 24 | string(defaultValue: env.BRANCH_NAME, description: '', name: 'GERRIT_BRANCH'), |
| 25 | string(defaultValue: 'osm/vim-emu', description: '', name: 'GERRIT_PROJECT'), |
| 26 | string(defaultValue: env.GERRIT_REFSPEC, description: '', name: 'GERRIT_REFSPEC'), |
| 27 | string(defaultValue: env.GERRIT_PATCHSET_REVISION, description: '', name: 'GERRIT_PATCHSET_REVISION'), |
| 28 | string(defaultValue: 'https://osm.etsi.org/gerrit', description: '', name: 'PROJECT_URL_PREFIX'), |
| 29 | booleanParam(defaultValue: false, description: '', name: 'TEST_INSTALL'), |
| 30 | string(defaultValue: 'artifactory-osm', description: '', name: 'ARTIFACTORY_SERVER'), |
| 31 | ]) |
| 32 | ]) |
| 33 | |
| 34 | def devops_checkout() { |
| 35 | dir('devops') { |
| 36 | git url: "${PROJECT_URL_PREFIX}/osm/devops", branch: params.GERRIT_BRANCH |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | node('docker') { |
| 41 | checkout scm |
| peusterm | 7f255b4 | 2019-10-01 13:33:42 +0200 | [diff] [blame] | 42 | |
| 43 | stage("Pre-Test") { |
| peusterm | dd4363b | 2019-10-01 13:42:48 +0200 | [diff] [blame^] | 44 | //sh "docker build -t osm/vim-emu-pre-test ." |
| 45 | sh "devops-stages/stage-pre-test.sh" |
| peusterm | 7f255b4 | 2019-10-01 13:33:42 +0200 | [diff] [blame] | 46 | } |
| 47 | |
| peusterm | 396e91e | 2017-10-25 16:20:51 +0200 | [diff] [blame] | 48 | devops_checkout() |
| 49 | |
| 50 | // vim-emu: We need to use privileged mode, docker.sock, and host pids for the container |
| 51 | // to test the emulator. Also needs -u 0:0 (root user inside container). |
| peusterm | 04dfa0a | 2019-09-26 21:25:09 +0200 | [diff] [blame] | 52 | //docker_args = "--privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock -u 0:0" |
| peusterm | 396e91e | 2017-10-25 16:20:51 +0200 | [diff] [blame] | 53 | |
| peusterm | 04dfa0a | 2019-09-26 21:25:09 +0200 | [diff] [blame] | 54 | |
| 55 | // call the normal OSM devops jobs (without root rights) |
| 56 | docker_args = "" |
| peusterm | 396e91e | 2017-10-25 16:20:51 +0200 | [diff] [blame] | 57 | ci_helper = load "devops/jenkins/ci-pipelines/ci_stage_2.groovy" |
| 58 | ci_helper.ci_pipeline( 'vim-emu', |
| 59 | params.PROJECT_URL_PREFIX, |
| 60 | params.GERRIT_PROJECT, |
| 61 | params.GERRIT_BRANCH, |
| 62 | params.GERRIT_REFSPEC, |
| 63 | params.GERRIT_PATCHSET_REVISION, |
| 64 | params.TEST_INSTALL, |
| 65 | params.ARTIFACTORY_SERVER, |
| 66 | docker_args) |
| 67 | } |