-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
54 lines (52 loc) · 1.19 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!groovy
def workerNode = "xp-build-i01"
pipeline {
agent {label workerNode}
options {
disableConcurrentBuilds()
}
environment {
DOCKER_TAG = "${env.BRANCH_NAME}-${env.BUILD_NUMBER}"
}
triggers {
pollSCM("H/02 * * * *")
upstream(upstreamProjects: "Docker-base-python3,ai/pyutils/master,ai/dbc-pytools/master",
threshold: hudson.model.Result.SUCCESS)
}
stages {
stage("test") {
agent {
docker {
label workerNode
image "docker-dbc.artifacts.dbccloud.dk/build-env"
alwaysPull true
}
}
steps {
sh """#!/usr/bin/env bash
set -xe
rm -rf env
python3 -m venv env
source env/bin/activate
pip install -U pip wheel
cd webservice-validation
pip install .
python3 -m unittest discover -s tests
"""
}
}
stage("build") {
steps {
script {
image = docker.build("build-env:${DOCKER_TAG}", "--no-cache --pull .")
docker.withRegistry("https://docker-dbc.artifacts.dbccloud.dk", "docker") {
image.push()
if (env.BRANCH_NAME ==~ /master|trunk/) {
image.push "latest"
}
}
}
}
}
}
}