-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
50 lines (48 loc) · 1.15 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
#!groovy
def workerNode = "devel9"
pipeline {
agent {
docker {
label workerNode
image "docker-dbc.artifacts.dbccloud.dk/build-env"
alwaysPull true
}
}
environment {
ARTIFACTORY_LOGIN = credentials("artifactory_login")
}
triggers {
pollSCM("H/02 * * * *")
}
stages {
stage("test") {
steps {
sh """#!/usr/bin/env bash
set -xe
rm -rf ENV
python3 -m venv ENV
source ENV/bin/activate
pip install -U pip
pip install .
python3 -m unittest discover -s tests
"""
}
}
stage("upload wheel package") {
when {
branch "master"
}
steps {
withCredentials([usernamePassword(credentialsId: 'DEVPI_LOGIN', usernameVariable: 'DEVPI_USR', passwordVariable: 'DEVPI_PSW')]) {
sh """#!/usr/bin/env bash
set -xe
rm -rf dist
python3 setup.py egg_info --tag-build=${env.BUILD_NUMBER} bdist_wheel
twine upload -u $ARTIFACTORY_LOGIN_USR -p $ARTIFACTORY_LOGIN_PSW --repository-url https://artifactory.dbc.dk/artifactory/api/pypi/pypi-dbc dist/*
twine upload -u ${DEVPI_USR} -p ${DEVPI_PSW} --repository-url https://devpi.dbccloud.dk/dbc/packages dist/*
"""
}
}
}
}
}