-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathJenkinsfile
57 lines (42 loc) · 1.53 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
55
56
57
#!/usr/bin/env groovy
@Library('sec_ci_libs@v2-latest') _
def master_branches = ["master", "dcos/1.8", "dcos/1.9", "dcos/1.10", "dcos/1.11", "dcos/1.12", "dcos/1.13"] as String[]
if (master_branches.contains(env.BRANCH_NAME)) {
// Rebuild main branch once a day
properties([
pipelineTriggers([cron('H H * * *')])
])
}
task_wrapper('mesos-sec', master_branches, '8b793652-f26a-422f-a9ba-0d1e47eb9d89', '#dcos-security-ci') {
def nameByBranch = ""
def nameByCommit = ""
stage("Verify author") {
user_is_authorized(master_branches, '8b793652-f26a-422f-a9ba-0d1e47eb9d89', '#dcos-security-ci')
}
stage('Cleanup workspace') {
deleteDir()
}
stage('Checkout') {
checkout scm
// http://stackoverflow.com/questions/35554983/git-variables-in-jenkins-workflow-plugin
// https://issues.jenkins-ci.org/browse/JENKINS-35230
def gitCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
nameByBranch = "mesosphereci/bouncer:" + "${env.BRANCH_NAME}".replaceAll('/','-')
nameByCommit = "mesosphereci/bouncer:${gitCommit}"
}
stage('make rebuild-container-images`') {
sh 'make rebuild-container-images'
}
try {
stage('make test') {
sh 'make test'
}
} finally {
stage('archive artifacts') {
archiveArtifacts allowEmptyArchive: true, artifacts: 'gunicorn_*.outerr', fingerprint: true
}
stage('make clean'){
sh 'make clean'
}
}
}