blob: 5c3570c01ac4c4a571eac434ef92c180e1889513 [file] [log] [blame]
Saheer Babuc87147b2025-08-15 12:27:32 +01001pipeline {
2 agent {
3 kubernetes {
4 yaml """
5apiVersion: v1
6kind: Pod
7spec:
8 volumes:
9 - name: docker-auth
10 emptyDir: {}
11
12 containers:
13 - name: awscli
14 image: amazon/aws-cli
15 command: ['cat']
16 tty: true
17 volumeMounts:
18 - name: docker-auth
19 mountPath: /root/.docker
20
21 - name: buildah
22 image: quay.io/buildah/stable
23 command: ['cat']
24 tty: true
25 env:
26 - name: STORAGE_DRIVER
27 value: vfs
28 volumeMounts:
29 - name: docker-auth
30 mountPath: /root/.docker
31"""
32 defaultContainer 'buildah'
33 }
34 }
35
Saheer Babuc87147b2025-08-15 12:27:32 +010036 stages {
Saheer Babudbbf8572025-08-15 12:40:21 +010037 stage('Build and Push Multiple Images') {
Saheer Babu1a0c5a22025-08-15 12:41:43 +010038 steps {
39 container('buildah') {
40 checkout scm
Saheer Babu39531ba2025-08-15 14:49:24 +010041
Saheer Babu9b82b912025-08-15 13:08:29 +010042 sh """
Saheer Babu79299ce2025-08-15 14:32:49 +010043 env
Saheer Babu39531ba2025-08-15 14:49:24 +010044 export PROJECT="dockerfiles"
45 git clone https://${env.GERRIT_HOST}/${env.GERRIT_PROJECT} ${env.PROJECT}
46 cd ${env.PROJECT}
Saheer Babu3d2ac252025-08-15 13:13:35 +010047 git fetch origin ${env.GERRIT_REFSPEC}
Saheer Babu9b82b912025-08-15 13:08:29 +010048 git checkout FETCH_HEAD
49 """
50
Saheer Babu1a0c5a22025-08-15 12:41:43 +010051 sh "env"
52 sh "ci-dockerfiles-deployment/build-version.sh"
53 sh "ci-dockerfiles-deployment/builders.sh"
54 sh "ci-dockerfiles-deployment/report.sh"
55 }
Saheer Babuc87147b2025-08-15 12:27:32 +010056 }
Saheer Babuc87147b2025-08-15 12:27:32 +010057 }
Saheer Babuc87147b2025-08-15 12:27:32 +010058 }
Saheer Babudbbf8572025-08-15 12:40:21 +010059}
60
61
62