Skip to content

Commit 4a6e057

Browse files
Create Jenkinsfile
1 parent b620f72 commit 4a6e057

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

Jenkinsfile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
pipeline {
2+
agent {
3+
dockerfile {
4+
label 'kube'
5+
}
6+
}
7+
8+
environment {
9+
ARTIFACTORY_CREDS = credentials('artifactory-service-account')
10+
ARTIFACTORY_URL = "https://jfrog.nonprod.pge.com/artifactory/api/pypi/arad-pypi-combined"
11+
}
12+
13+
stages {
14+
stage('Lint') {
15+
steps {
16+
sh 'mkdir -p reports'
17+
sh 'flake8 --tee --output-file reports/pep8.log'
18+
}
19+
}
20+
21+
stage('Test') {
22+
steps {
23+
sh 'mkdir -p reports'
24+
sh 'py.test --cov=. --cov-report xml:./reports/coverage.xml'
25+
}
26+
}
27+
28+
stage('Deploy') {
29+
when { anyOf { tag 'release-*' } }
30+
steps {
31+
configFileProvider([configFile(fileId: 'artifactory-ssl-certificate', targetLocation: 'artifactory.pem')]) {
32+
sh 'python setup.py sdist'
33+
sh 'twine upload --repository-url ${ARTIFACTORY_URL} -p ${ARTIFACTORY_CREDS_PSW} -u ${ARTIFACTORY_CREDS_USR} --cert ./artifactory.pem dist/*'
34+
}
35+
}
36+
}
37+
}
38+
post {
39+
always {
40+
cobertura coberturaReportFile: '**/coverage.xml'
41+
recordIssues tool: flake8(pattern: 'reports/pep8.log'), failedTotalAll: 1, enabledForFailure: true
42+
}
43+
}
44+
}

0 commit comments

Comments
 (0)