Add container build jpl
Change-Id: If3b8479a450788016e42d4814eb3443dd0375837
Signed-off-by: Saheer Babu <saheer.babu@arm.com>
diff --git a/ci/container-build.jpl b/ci/container-build.jpl
index cdf7b91..a3be6b9 100644
--- a/ci/container-build.jpl
+++ b/ci/container-build.jpl
@@ -33,60 +33,18 @@
}
}
- environment {
- AWS_REGION = "eu-west-1"
- ECR_REGISTRY = "123456789012.dkr.ecr.eu-west-1.amazonaws.com"
- }
-
stages {
- stage('Build and Push Multiple Images') {
- steps {
- script {
- def images = ['app1', 'app2', 'base']
-
- for (img in images) {
- stage("Build and Push ${img}") {
- // Clone repo and build the image
- container('buildah') {
+ stage('Build and Push Multiple Images') {
+ container('buildah') {
checkout scm
sh "env"
- sh """
- echo "[INFO] Cloning repo..."
- env
- gitRepo="${GIT_BASE_URL}${env.GERRIT_PROJECT}"
- git clone ${gitRepo} repo
- cd /repo
-
- echo "[INFO] Building image: ${img}"
- buildah bud -t ${img} -f Dockerfile.${img} .
-
- echo "[INFO] Tagging image"
- buildah tag ${img} ${ECR_REGISTRY}/${img}:latest
- """
- }
-
- // Dynamic login before push
- container('awscli') {
- withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', credentialsId: 'aws-creds']]) {
- sh """
- echo "[INFO] Logging into ECR before pushing ${img}"
- aws ecr get-login-password --region $AWS_REGION | \
- docker login --username AWS --password-stdin $ECR_REGISTRY
- """
- }
- }
-
- // Push after dynamic login
- container('buildah') {
- sh """
- echo "[INFO] Pushing image: ${img}"
- buildah push ${ECR_REGISTRY}/${img}:latest
- """
- }
+ sh "ci-dockerfiles-deployment/build-version.sh"
+ sh "ci-dockerfiles-deployment/builders.sh"
+ sh "ci-dockerfiles-deployment/report.sh"
}
- }
}
- }
}
- }
-}
\ No newline at end of file
+}
+
+
+