SEBA-457 Restrict the set of services to be tested to a whitelist

Change-Id: I34992fbc69b7b0163b6b6d63513466cff37683ee
diff --git a/jjb/pipeline/xos-synchronizer-update.groovy b/jjb/pipeline/xos-synchronizer-update.groovy
index f677521..2137652 100644
--- a/jjb/pipeline/xos-synchronizer-update.groovy
+++ b/jjb/pipeline/xos-synchronizer-update.groovy
@@ -116,6 +116,8 @@
            #!/usr/bin/env bash
            set -eu -o pipefail
 
+           ALLOWED_SERVICES="att-workflow-driver fabric fabric-crossconnect kubernetes-service olt-service onos-service rcord simpleexampleservice"
+
            echo "" > $WORKSPACE/xos_tags.yaml
            echo "" > $WORKSPACE/updated_dockerfiles
            XOS_MAJOR=\$(cut -b 1 cord/orchestration/xos/VERSION)
@@ -124,12 +126,18 @@
            # update services
            for df in cord/orchestration/xos_services/*/Dockerfile.synchronizer
            do
-             df_contents=\$(cat "\$df")
-             if [[ "\$df_contents" =~ "FROM xosproject/xos-synchronizer-base:\$XOS_MAJOR" ||
-                   "\$df_contents" =~ "FROM xosproject/xos-synchronizer-base:master" ]]
+             service_dirname=\$(basename \$(dirname "\$df"))
+             if [[ "\$ALLOWED_SERVICES" =~ "\$service_dirname" ]]
              then
-               sed -i "s/^FROM\\(.*\\):.*\$/FROM\\1:\$XOS_VERSION/" "\$df"
-               echo "$WORKSPACE/\$df" >> $WORKSPACE/updated_dockerfiles
+                 df_contents=\$(cat "\$df")
+                 if [[ "\$df_contents" =~ "FROM xosproject/xos-synchronizer-base:\$XOS_MAJOR" ||
+                       "\$df_contents" =~ "FROM xosproject/xos-synchronizer-base:master" ]]
+                 then
+                   sed -i "s/^FROM\\(.*\\):.*\$/FROM\\1:\$XOS_VERSION/" "\$df"
+                   echo "$WORKSPACE/\$df" >> $WORKSPACE/updated_dockerfiles
+                 fi
+             else
+                 echo "\$service_dirname not in ALLOWED_SERVICES. Not Testing."
              fi
            done