/
Jenkinsfile
105 lines (94 loc) · 2.43 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
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
#!/usr/bin/env groovy
// 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") {
release.promote(params.VERSION_TO_PROMOTE) { infrapool
}
return
}
pipeline {
agent { label 'conjur-enterprise-common-agent' }
options {
timestamps()
buildDiscarder(logRotator(daysToKeepStr: '30'))
}
triggers {
cron(getDailyCronString())
}
stages {
stage('Scan for internal URLs') {
steps {
script {
detectInternalUrls()
}
}
}
stage('Get InfraPool ExecutorV2 Agent') {
steps {
script {
// Request InfraPool
INFRAPOOL_EXECUTORV2_AGENT_0 = getInfraPoolAgent.connected(type: "ExecutorV2", quantity: 1, duration: 1)[0]
}
}
}
stage('Get latest upstream dependencies') {
steps {
script {
updatePrivateGoDependencies("${WORKSPACE}/go.mod")
// Copy the vendor directory onto infrapool
INFRAPOOL_EXECUTORV2_AGENT_0.agentPut from: "vendor", to: "${WORKSPACE}"
INFRAPOOL_EXECUTORV2_AGENT_0.agentPut from: "go.*", to: "${WORKSPACE}"
}
}
}
stage('Validate') {
parallel {
stage('Changelog') {
steps { parseChangelog(INFRAPOOL_EXECUTORV2_AGENT_0) }
}
}
}
stage('Build artifacts') {
steps {
script {
INFRAPOOL_EXECUTORV2_AGENT_0.agentSh './bin/build'
INFRAPOOL_EXECUTORV2_AGENT_0.agentArchiveArtifacts artifacts: "dist/*.tar.gz,dist/*.zip,dist/*.txt,dist/*.rb,dist/*_SHA256SUMS", fingerprint: true
}
}
}
stage('Run integration tests (OSS)') {
steps {
script {
INFRAPOOL_EXECUTORV2_AGENT_0.agentSh './bin/test oss'
}
}
}
stage('Run integration tests (Conjur 5 Enterprise)') {
steps {
script {
INFRAPOOL_EXECUTORV2_AGENT_0.agentSh './bin/test enterprise'
}
}
}
stage('Run integration tests (cloud)'){
steps {
script {
INFRAPOOL_EXECUTORV2_AGENT_0.agentSh 'summon ./bin/test cloud'
}
}
}
}
post {
always {
script {
releaseInfraPoolAgent(".infrapool/release_agents")
}
}
}
}