-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathJenkinsfile
More file actions
144 lines (128 loc) · 5.09 KB
/
Jenkinsfile
File metadata and controls
144 lines (128 loc) · 5.09 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
@Library('releng-pipeline@main') _
pipeline {
agent any
options {
skipDefaultCheckout()
buildDiscarder(logRotator(numToKeepStr: '5'))
timeout(time: 90, unit: 'MINUTES')
}
environment {
HOME = '${env.WORKSPACE}'
NAMESPACE = 'eclipsefdn'
CREDENTIALS_ID = '04264967-fea0-40c2-bf60-09af5aeba60f'
}
triggers {
cron('H H * * H')
}
stages {
stage('Checkout Workspace') {
steps {
checkout scm
stash(name: 'workspace', includes: '**')
}
}
stage('Run Builds') {
parallel {
stage('nginx') {
steps {
buildImage('nginx', 'stable-alpine', 'nginx/stable-alpine', [:], true)
buildImage('nginx', 'stable-alpine-for-staging', 'nginx/stable-alpine-for-staging')
}
}
stage('planet-venus') {
steps {
buildImage('planet-venus', 'debian-11-slim', 'planet-venus', [:], true)
}
}
stage('kubectl') {
steps {
buildImage('kubectl', 'okd-c1', 'kubectl/okd-c1', [:], true)
}
}
stage('hugo-node') {
steps {
buildImage('hugo-node', 'h0.99.1-n16.15.0', 'hugo-node', ['HUGO_VERSION':'0.99.1', 'HUGO_FILENAME':'hugo_0.99.1_Linux-64bit.deb','NODE_VERSION': 'v16.15.0'])
buildImage('hugo-node', 'h0.110.0-n18.19.1', 'hugo-node', ['HUGO_VERSION':'0.110.0', 'NODE_VERSION': 'v18.19.1'], true)
buildImage('hugo-node', 'h0.120.4-n18.19.1', 'hugo-node', ['DEBIAN_VERSION':'12-slim', 'HUGO_VERSION':'0.120.4', 'NODE_VERSION': 'v18.19.1'])
buildImage('hugo-node', 'h0.124.1-n20.11.1', 'hugo-node', ['DEBIAN_VERSION':'12-slim', 'HUGO_VERSION':'0.124.1', 'NODE_VERSION': 'v20.11.1'])
buildImage('hugo-node', 'h0.144.2-n22.14.0', 'hugo-node', ['DEBIAN_VERSION':'12-slim', 'HUGO_VERSION':'0.144.2', 'NODE_VERSION': 'v22.14.0'])
}
}
stage('drupal-node') {
steps {
buildImage('drupal-node', 'd10.6.6-n22.14.0', 'drupal-node', ['DRUPAL_VERSION':'10.6.6', 'NODE_VERSION': 'v22.14.0'], true)
buildImage('drupal-node', 'd11.2.10-n22.14.0', 'drupal-node', ['DRUPAL_VERSION':'11.2.10', 'NODE_VERSION': 'v22.14.0'])
}
}
stage('stack-build-agent') {
steps {
buildImage('stack-build-agent', 'h111.3-n18.19-jdk11', 'stack-build-agent', [:], true)
buildImage('stack-build-agent', 'h111.3-n18.19-jdk17', 'stack-build-agent', ['JDK_VERSION':'17'])
buildImage('stack-build-agent', 'a3.19-h120-n20-jdk17', 'stack-build-agent', ['ALPINE_VERSION':'3.19', 'JDK_VERSION':'17', 'NODE_VERSION':'20.15.1-r0', 'NPM_VERSION':'10.2.5-r0', 'HUGO_VERSION':'0.120.4', 'YARN_VERSION':'1.22.19-r0'])
buildImage('stack-build-agent', 'a3.22-h144-n22-jdk21', 'stack-build-agent', ['ALPINE_VERSION':'3.22', 'JDK_VERSION':'21', 'NODE_VERSION':'22.22.2-r0', 'NPM_VERSION':'11.6.4-r0', 'HUGO_VERSION':'0.144.2', 'YARN_VERSION':'1.22.22-r1'])
}
}
stage('java-api-base') {
steps {
buildImage('java-api-base', 'j11-openjdk', 'java-api-base', ['JDK_VERSION':'11:1.17'])
buildImage('java-api-base', 'j17-openjdk', 'java-api-base', ['JDK_VERSION':'17:1.22-1.1752621170'], true)
buildImage('java-api-base', 'j21-openjdk', 'java-api-base', ['JDK_VERSION':'21:1.22-1.1752676422'])
}
}
stage('native-build-agent') {
steps {
buildImage('native-build-agent', 'jdk21-n22', 'native-build-agent', ['NODE_VERSION':'v22.17.0'], true)
}
}
stage('containertools') {
steps {
buildImage('containertools', 'alpine-latest', 'containertools', [:], true)
}
}
stage('aws') {
steps {
buildImage('aws', 'alpine-latest', 'aws/alpine-latest', [:], true)
}
}
}
}
}
post {
always {
deleteDir() /* clean up workspace */
sendNotifications currentBuild
}
}
}
def buildImage(String name, String version, String context, Map<String, String> buildArgs = [:], boolean latest = false) {
String distroName = "${env.NAMESPACE}/${name}:${version}"
def containerBuildArgs = buildArgs.collect { k, v -> "--opt build-arg:${k}=${v}" }.join(' ')
def pushArg = "${env.BRANCH_NAME}" == 'master'
println """
"###### Build Image: ${distroName}
* Version ${version}
* Build Params ${buildArgs}
* Build Args ${containerBuildArgs}
* Dockerfile ${context}/Dockerfile
* Push ${pushArg}
* Latest ${latest}
"""
podTemplate(yaml: loadOverridableResource(libraryResource: 'org/eclipsefdn/container/agent.yml')) {
node(POD_LABEL) {
container('containertools') {
unstash('workspace')
containerBuild(
credentialsId: env.CREDENTIALS_ID,
name: env.NAMESPACE + '/' + name,
version: version,
dockerfile: context + '/Dockerfile',
context: context,
buildArgs: containerBuildArgs,
push: pushArg,
latest: latest,
debug: false
)
}
}
}
}