unified script calling

Change-Id: Iab45c5051568b69b9b5f41162480b82731a63478
Signed-off-by: lj1412 <lji@research.att.com>
diff --git a/jjb/dcae/dmaapbc.yaml b/jjb/dcae/dmaapbc.yaml
index dee2e95..97ec8b7 100644
--- a/jjb/dcae/dmaapbc.yaml
+++ b/jjb/dcae/dmaapbc.yaml
@@ -24,13 +24,13 @@
           mvn-goals: 'clean deploy'
           maven-deploy-properties: |
               deployAtEnd=true
-          script:
-            !include-raw-escape: 'script-dmaapbc-daily-release.sh'
+          script: |
+            bash ./script-dmaap-docker-build.sh release
       - '{project-name}-{stream}-merge-scm-mvn-script':
           mvn-goals: 'clean deploy'
-          script:
-            !include-raw-escape: 'script-dmaapbc-merge.sh'
+          script: |
+            bash ./script-dmaap-docker-build.sh merge
       - '{project-name}-{stream}-verify-scm-mvn-script':
           mvn-goals: 'clean install'
           script:
-            !include-raw-escape: 'script-dmaapbc-verify.sh'
+            bash ./script-dmaap-docker-build.sh verify
diff --git a/jjb/dcae/pgaas.yaml b/jjb/dcae/pgaas.yaml
index 7be82ed..a94b53a 100644
--- a/jjb/dcae/pgaas.yaml
+++ b/jjb/dcae/pgaas.yaml
@@ -21,11 +21,11 @@
       - '{project-name}-{stream}-daily-release-2scm-mvn-script':
           maven-deploy-properties: |
               deployAtEnd=true
-          script:
-            !include-raw-escape: 'script-pgaas-daily-release.sh'
+          script: |
+            bash ./script-pgaas-deb-build.sh release
       - '{project-name}-{stream}-merge-2scm-mvn-script':
-          script:
-            !include-raw-escape: 'script-pgaas-merge.sh'
+          script: |
+            bash ./script-pgaas-deb-build.sh merge
       - '{project-name}-{stream}-verify-2scm-mvn-script':
-          script:
-            !include-raw-escape: 'script-pgaas-verify.sh'
+          script: |
+            bash ./script-pgaas-deb-build.sh verify
diff --git a/jjb/dcae/script-dmaapbc-daily-release.sh b/jjb/dcae/script-dmaapbc-daily-release.sh
deleted file mode 100755
index 710a319..0000000
--- a/jjb/dcae/script-dmaapbc-daily-release.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-# Create a debian package and push to remote repo
-#
-#
-# build the docker image. tag and then push to the remote repo
-#
-
-# !!! make sure the yaml file include docker-login as a builder before calling
-# this script
-
-IMAGE="dcae_dmaapbc"
-TAG="1.0.0"
-LFQI="${IMAGE}:${TAG}"
-BUILD_PATH="${WORKSPACE}"
-
-# build a docker image
-docker build --rm -f ${WORKSPACE}/Dockerfile -t ${LFQI} ${BUILD_PATH}
-
-
-#
-# push the image
-#
-# io registry  DOCKER_REPOSITORIES="nexus3.openecomp.org:10001 \
-# release registry                   nexus3.openecomp.org:10002 \
-# snapshot registry                   nexus3.openecomp.org:10003"
-REPO="nexus3.openecomp.org:10003"
-
-RFQI="${REPO}/${LFQI}"
-# tag
-docker tag ${LFQI} ${RFQI}
-
-# push to remote repo
-docker push ${RFQI}
-
diff --git a/jjb/dcae/script-dmaapbc-merge.sh b/jjb/dcae/script-dmaapbc-merge.sh
deleted file mode 100755
index dd35091..0000000
--- a/jjb/dcae/script-dmaapbc-merge.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-# Create a debian package and push to remote repo
-#
-#
-# build the docker image. tag and then push to the remote repo
-#
-
-# !!! make sure the yaml file include docker-login as a builder before calling
-# this script
-
-IMAGE='dcae_dmaapbc'
-TAG='1.0.0'
-LFQI="${IMAGE}:${TAG}"
-BUILD_PATH="${WORKSPACE}"
-
-# build a docker image
-docker build --rm -f "${WORKSPACE}"/Dockerfile -t "${LFQI}" "${BUILD_PATH}"
-
-
-#
-# push the image
-#
-# io registry  DOCKER_REPOSITORIES="nexus3.openecomp.org:10001 \
-# release registry                   nexus3.openecomp.org:10002 \
-# snapshot registry                   nexus3.openecomp.org:10003"
-REPO='nexus3.openecomp.org:10003'
-RFQI="${REPO}/${LFQI}"
-docker tag ${LFQI} ${RFQI}
-docker push ${RFQI}
-
diff --git a/jjb/dcae/script-dmaapbc-verify.sh b/jjb/dcae/script-dmaapbc-verify.sh
deleted file mode 100755
index 8db2c9c..0000000
--- a/jjb/dcae/script-dmaapbc-verify.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-# Create a debian package and push to remote repo
-#
-#
-# build the docker image. tag and then push to the remote repo
-#
-
-# !!! make sure the yaml file include docker-login as a builder before calling
-# this script
-
-IMAGE="dcae_dmaapbc"
-TAG="1.0.0"
-LFQI="${IMAGE}:${TAG}"
-BUILD_PATH="${WORKSPACE}"
-
-# build a docker image
-docker build --rm -f ${WORKSPACE}/Dockerfile -t ${LFQI} ${BUILD_PATH}
-
-
diff --git a/jjb/dcae/script-pgaas-daily-release.sh b/jjb/dcae/script-pgaas-daily-release.sh
deleted file mode 100755
index 0a4e343..0000000
--- a/jjb/dcae/script-pgaas-daily-release.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-# Create a debian package and push to remote repo
-#
-echo "============== STARTING SCRIPT TO CREATE DEBIAN FILES ================="
-
-export BUILD_NUMBER="${BUILD_ID}"
-export PATH=$PATH:${WORKSPACE}/buildtools/bin
-
-export NEXUS_RAW="${NEXUSPROXY}/content/sites/raw"
-USER=$(xpath -q -e \
-    "//servers/server[id='ecomp-raw']/username/text()" "$SETTINGS_FILE")
-PASS=$(xpath -q -e \
-    "//servers/server[id='ecomp-raw']/password/text()" "$SETTINGS_FILE")
-
-# Create a netrc file for use with curl
-export NETRC=$(mktemp)
-echo "machine nexus.openecomp.org login ${USER} password ${PASS}" > "${NETRC}"
-
-echo $NEXUS_RAW
-
-
-REPO="${NEXUS_RAW}/org.openecomp.dcae.pgaas/deb-snapshots"
-
-export REPACKAGEDEBIANUPLOAD="set -x; curl -k --netrc-file '${NETRC}' \
-    --upload-file '{0}' '${REPO}/{2}/{1}'"
-export REPACKAGEDEBIANUPLOAD2="set -x; curl -k --netrc-file '${NETRC}' \
-    --upload-file '{0}' '${REPO}/{2}/{4}-LATEST.deb'"
-make debian
-echo "================= ENDING SCRIPT TO CREATE DEBIAN FILES ================="
-
-#echo "============= STARTING SCRIPT TO CREATE JAVADOCS FILES ================"
-#make upload-javadocs
-#echo "============= ENDING SCRIPT TO CREATE JAVADOCS FILES =================="
diff --git a/jjb/dcae/script-pgaas-merge.sh b/jjb/dcae/script-pgaas-merge.sh
deleted file mode 100755
index 0a4e343..0000000
--- a/jjb/dcae/script-pgaas-merge.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-# Create a debian package and push to remote repo
-#
-echo "============== STARTING SCRIPT TO CREATE DEBIAN FILES ================="
-
-export BUILD_NUMBER="${BUILD_ID}"
-export PATH=$PATH:${WORKSPACE}/buildtools/bin
-
-export NEXUS_RAW="${NEXUSPROXY}/content/sites/raw"
-USER=$(xpath -q -e \
-    "//servers/server[id='ecomp-raw']/username/text()" "$SETTINGS_FILE")
-PASS=$(xpath -q -e \
-    "//servers/server[id='ecomp-raw']/password/text()" "$SETTINGS_FILE")
-
-# Create a netrc file for use with curl
-export NETRC=$(mktemp)
-echo "machine nexus.openecomp.org login ${USER} password ${PASS}" > "${NETRC}"
-
-echo $NEXUS_RAW
-
-
-REPO="${NEXUS_RAW}/org.openecomp.dcae.pgaas/deb-snapshots"
-
-export REPACKAGEDEBIANUPLOAD="set -x; curl -k --netrc-file '${NETRC}' \
-    --upload-file '{0}' '${REPO}/{2}/{1}'"
-export REPACKAGEDEBIANUPLOAD2="set -x; curl -k --netrc-file '${NETRC}' \
-    --upload-file '{0}' '${REPO}/{2}/{4}-LATEST.deb'"
-make debian
-echo "================= ENDING SCRIPT TO CREATE DEBIAN FILES ================="
-
-#echo "============= STARTING SCRIPT TO CREATE JAVADOCS FILES ================"
-#make upload-javadocs
-#echo "============= ENDING SCRIPT TO CREATE JAVADOCS FILES =================="
diff --git a/jjb/dcae/script-pgaas-verify.sh b/jjb/dcae/script-pgaas-verify.sh
deleted file mode 100755
index 51c802f..0000000
--- a/jjb/dcae/script-pgaas-verify.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-# Create a debian package and push to remote repo
-#
-echo "============== STARTING SCRIPT TO CREATE DEBIAN FILES ================="
-
-export BUILD_NUMBER="${BUILD_ID}"
-export PATH=$PATH:${WORKSPACE}/buildtools/bin
-
-export NEXUS_RAW="${NEXUSPROXY}/content/sites/raw"
-USER=$(xpath -q -e \
-    "//servers/server[id='ecomp-raw']/username/text()" "$SETTINGS_FILE")
-PASS=$(xpath -q -e \
-    "//servers/server[id='ecomp-raw']/password/text()" "$SETTINGS_FILE")
-
-# Create a netrc file for use with curl
-export NETRC=$(mktemp)
-echo "machine nexus.openecomp.org login ${USER} password ${PASS}" > "${NETRC}"
-
-echo $NEXUS_RAW
-
-
-REPO="${NEXUS_RAW}/org.openecomp.dcae.devnull/"
-
-export REPACKAGEDEBIANUPLOAD="set -x; curl -k --netrc-file '${NETRC}' \
-    --upload-file '{0}' '${REPO}/{2}/{1}'"
-export REPACKAGEDEBIANUPLOAD2="set -x; curl -k --netrc-file '${NETRC}' \
-    --upload-file '{0}' '${REPO}/{2}/{4}-LATEST.deb'"
-make debian
-echo "================= ENDING SCRIPT TO CREATE DEBIAN FILES ================="
-
-#echo "============= STARTING SCRIPT TO CREATE JAVADOCS FILES ================"
-#make upload-javadocs
-#echo "============= ENDING SCRIPT TO CREATE JAVADOCS FILES =================="