1 // Copyright (c) 2018 by Paderborn University
3 // ALL RIGHTS RESERVED.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
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
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'),
34 def devops_checkout() {
36 git url: "${PROJECT_URL_PREFIX}/osm/devops", branch: params.GERRIT_BRANCH
45 // call the normal OSM devops jobs (without root rights)
47 ci_helper = load "devops/jenkins/ci-pipelines/ci_stage_2.groovy"
48 ci_helper.ci_pipeline( 'vim-emu',
49 params.PROJECT_URL_PREFIX,
50 params.GERRIT_PROJECT,
52 params.GERRIT_REFSPEC,
53 params.GERRIT_PATCHSET_REVISION,
55 params.ARTIFACTORY_SERVER,
58 // custom test stage that executes vim-emu's unit tests as root
59 // we cannot do this as part of the normal stage 2 since it would create
60 // files owned by root that could not be cleaned up.
63 sh "docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock -u 0:0 osm/vim-emu-master pip list"
64 sh "docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock -u 0:0 osm/vim-emu-master pytest -v"
65 sh "docker run --rm --privileged --pid='host' -v /var/run/docker.sock:/var/run/docker.sock -u 0:0 osm/vim-emu-master flake8 --exclude=.eggs,devops,build,examples/charms --ignore=E501,W605,W504 ."