-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
116 lines (103 loc) · 3.3 KB
/
Jenkinsfile
File metadata and controls
116 lines (103 loc) · 3.3 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/usr/bin/env groovy
@Library("product-pipelines-shared-library") _
// Automated release, promotion and dependencies
properties([
// Include the automated release parameters for the build
release.addParams(),
// Dependencies of the project that should trigger builds
dependencies([])
])
// Performs release promotion. No other stages will be run
if (params.MODE == "PROMOTE") {
// Copy Github Enterprise commit to Github
release.copyEnterpriseCommit('conjurdemos')
return
}
pipeline {
agent { label 'conjur-enterprise-common-agent' }
options {
timestamps()
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '30'))
timeout(time: 1, unit: 'HOURS')
}
triggers {
cron(getDailyCronString())
}
environment {
// Sets the MODE to the specified or autocalculated value as appropriate
MODE = release.canonicalizeMode()
}
parameters {
booleanParam(name: 'TEST_OCP_NEXT', defaultValue: false, description: 'Run Conjur Enterprise tests against our running "next version" of Openshift')
booleanParam(name: 'TEST_OCP_OLDEST', defaultValue: false, description: 'Run Conjur Enterprise tests against our running "oldest version" of Openshift')
}
stages {
stage('Get InfraPool ExecutorV2 Agent') {
steps {
dir("deploy/kubernetes-conjur-deploy") {
checkout([
$class: 'GitSCM',
branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations,
extensions: [[$class: 'CloneOption', noTags: false, shallow: false, depth: 0, reference: '']],
userRemoteConfigs: [[url: 'https://github.com/cyberark/kubernetes-conjur-deploy', credentialsId: 'jenkins_ci_token' ]] ,
])
}
script {
INFRAPOOL_EXECUTORV2_AGENT_0 = getInfraPoolAgent.connected(type: "ExecutorV2", quantity: 1, duration: 2)[0]
}
}
}
// Aborts any builds triggered by another project that wouldn't include any changes
stage("Skip build if triggering job didn't create a release") {
when {
expression {
MODE == "SKIP"
}
}
steps {
script {
currentBuild.result = 'ABORTED'
error("Aborting build because this build was triggered from upstream, but no release was built")
}
}
}
stage('Scan for internal URLs') {
steps {
script {
detectInternalUrls()
}
}
}
stage("Run E2E test flow") {
steps {
script {
def tasks = [:]
tasks["Kubernetes GKE"] = {
INFRAPOOL_EXECUTORV2_AGENT_0.agentSh "./bin/start --docker --gke"
}
tasks["OpenShift (Current)"] = {
INFRAPOOL_EXECUTORV2_AGENT_0.agentSh "./bin/start --docker --current"
}
if ( params.TEST_OCP_OLDEST ) {
tasks["OpenShift (Oldest)"] = {
INFRAPOOL_EXECUTORV2_AGENT_0.agentSh "./bin/start --docker --oldest"
}
}
if ( params.TEST_OCP_NEXT ) {
tasks["OpenShift (Next)"] = {
INFRAPOOL_EXECUTORV2_AGENT_0.agentSh "./bin/start --docker --next"
}
}
parallel tasks
}
}
}
}
post {
always {
releaseInfraPoolAgent(".infrapool/release_agents")
}
}
}