-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
35 lines (30 loc) · 1.08 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
@Library('xcnt-jenkins-scripts') _
def project = 'xcnt-infrastructure'
def appName = 'cname-record-setter'
def label = "${appName}_${env.BRANCH_NAME}"
dockerBuildRuntime(label: label) {
def myRepo = checkout scm
def image = "eu.gcr.io/${project}/${appName}"
def imageWithTag = ""
stage('Build image') {
loginToDocker()
container('docker') {
imageWithTag = buildImage(image, env.BRANCH_NAME, myRepo.GIT_COMMIT)
}
}
stage('Run PEP8') {
container('docker') {
try {
sh """
docker run -i ${imageWithTag} python -m pycodestyle --config pycodestyle . > pep8_report.txt
"""
} finally {
recordIssues enabledForFailure: true, tool: pep8(pattern: '**/pep8_report.txt'), qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]]
}
}
}
stage('Publish') {
publishImage(image, env.BRANCH_NAME, myRepo.GIT_COMMIT)
publishImageToPublicDocker("xcnt/cname-record-setter", image, env.BRANCH_NAME, myRepo.GIT_COMMIT)
}
}