Run for multiple architectures

Change-Id: Ibe867a40fcc2112992cca75f23ff1a2f3e6fd006
Signed-off-by: Saheer Babu <saheer.babu@arm.com>
diff --git a/ci-dockerfiles-deployment/builders.sh b/ci-dockerfiles-deployment/builders.sh
index b0ed7be..b9843ae 100755
--- a/ci-dockerfiles-deployment/builders.sh
+++ b/ci-dockerfiles-deployment/builders.sh
@@ -96,15 +96,14 @@
     skip="no"
   fi
   case "${skip}:${host_arch}:${image_arch}" in
-    # "skip:"*)
-    #   echo "Skipping: don't need to build ${image} on branch ${GERRIT_BRANCH}"
-    #   ;;
+    "skip:"*)
+      echo "Skipping: don't need to build ${image} on branch ${GERRIT_BRANCH}"
+      ;;
     "no:amd64:amd64"|"no:amd64:i386"|"no:arm64:arm64"|"no:armhf:armhf")
       echo "=== Start build: ${image} ==="
       bash -x ./build.sh || echo "=== FAIL: ${image} ===" >> ${WORKSPACE}/log
       ;;
     *)
-      bash -x ./build.sh || echo "=== FAIL: ${image} ===" >> ${WORKSPACE}/log
       echo "Skipping: can't build for ${image_arch} on ${host_arch}"
       ;;
   esac
diff --git a/ci-dockerfiles-deployment/container-build.jpl b/ci-dockerfiles-deployment/container-build.jpl
index abbb63f..a38eeab 100644
--- a/ci-dockerfiles-deployment/container-build.jpl
+++ b/ci-dockerfiles-deployment/container-build.jpl
@@ -1,33 +1,59 @@
 pipeline {
-  agent {
-    label 'docker-container-builder'
-  }
+  agent none
 
   stages {
-        stage('Build and Push Multiple Images') {
-            steps {
+    stage('Build and Push for Multiple Architectures') {
+      parallel {
+        stage('Build for amd64') {
+          agent {
+            label 'docker-container-builder-amd64'
+          }
+          stages {
+            stage('Build') {
+              steps {
                 container('image-builder') {
-                    checkout scm
-
-
-                    sh '''
-                      env
-                      PROJECT="dockerfiles"
-                      git clone https://${GERRIT_HOST}/${GERRIT_PROJECT} ${PROJECT}
-                      cd ${PROJECT}
-                      git fetch origin ${GERRIT_REFSPEC}
-                      git checkout FETCH_HEAD
-                    '''
-
-                    sh "env"
-                    sh "ci-dockerfiles-deployment/build-version.sh"
-                    sh "ci-dockerfiles-deployment/builders.sh"
-                    sh "ci-dockerfiles-deployment/report.sh"
+                  checkout scm
+                  sh '''
+                    PROJECT="dockerfiles"
+                    git clone https://${GERRIT_HOST}/${GERRIT_PROJECT} ${PROJECT}
+                    cd ${PROJECT}
+                    git fetch origin ${GERRIT_REFSPEC}
+                    git checkout FETCH_HEAD
+                  '''
+                  sh "ci-dockerfiles-deployment/build-version.sh"
+                  sh "ci-dockerfiles-deployment/builders.sh"
+                  sh "ci-dockerfiles-deployment/report.sh"
                 }
+              }
             }
+          }
         }
+
+        stage('Build for arm64') {
+          agent {
+            label 'docker-container-builder-arm64'
+          }
+          stages {
+            stage('Build') {
+              steps {
+                container('image-builder') {
+                  checkout scm
+                  sh '''
+                    PROJECT="dockerfiles"
+                    git clone https://${GERRIT_HOST}/${GERRIT_PROJECT} ${PROJECT}
+                    cd ${PROJECT}
+                    git fetch origin ${GERRIT_REFSPEC}
+                    git checkout FETCH_HEAD
+                  '''
+                  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