diff options
-rw-r--r-- | jjb/appc/appc-deployment.yaml | 4 | ||||
-rw-r--r-- | jjb/appc/appc.yaml | 1 | ||||
-rw-r--r-- | jjb/dcae/apod-cdap.yaml | 32 | ||||
-rw-r--r-- | jjb/dcae/dcae-controller-analytics.yaml | 2 | ||||
-rw-r--r-- | jjb/dcae/dcae-controller.yaml | 2 | ||||
-rw-r--r-- | jjb/dcae/dcae-operation-utils.yaml | 2 | ||||
-rw-r--r-- | jjb/dcae/include-raw-apod-cdap.sh | 91 | ||||
-rw-r--r-- | jjb/global-macros.yaml | 18 | ||||
-rw-r--r-- | jjb/global-templates-java.yaml | 132 | ||||
-rw-r--r-- | jjb/mso/mso-libs.yaml | 2 | ||||
-rw-r--r-- | jjb/mso/mso.yaml | 2 | ||||
-rw-r--r-- | jjb/ncomp/ncomp-cdap.yaml | 2 | ||||
-rw-r--r-- | jjb/ncomp/ncomp-core.yaml | 2 | ||||
-rw-r--r-- | jjb/ncomp/ncomp-docker.yaml | 2 | ||||
-rw-r--r-- | jjb/ncomp/ncomp-maven.yaml | 2 | ||||
-rw-r--r-- | jjb/ncomp/ncomp-openstack.yaml | 2 | ||||
-rw-r--r-- | jjb/ncomp/ncomp-sirius-manager.yaml | 2 | ||||
-rw-r--r-- | jjb/ncomp/ncomp-utils.yaml | 5 |
18 files changed, 291 insertions, 14 deletions
diff --git a/jjb/appc/appc-deployment.yaml b/jjb/appc/appc-deployment.yaml index fdc48b63a..71be09bcb 100644 --- a/jjb/appc/appc-deployment.yaml +++ b/jjb/appc/appc-deployment.yaml @@ -6,6 +6,8 @@ jobs: - '{project-name}-{stream}-verify-java' - '{project-name}-{stream}-merge-java' + - '{project-name}-{stream}-release-java-daily' + - '{project-name}-{stream}-docker-java-daily' project: 'appc/deployment' stream: @@ -14,3 +16,5 @@ mvn-settings: 'appc-deployment-settings' files: '**' archive-artifacts: '' + docker-pom: 'pom.xml' + mvn-profile: docker diff --git a/jjb/appc/appc.yaml b/jjb/appc/appc.yaml index b03a9b741..8555f696c 100644 --- a/jjb/appc/appc.yaml +++ b/jjb/appc/appc.yaml @@ -6,6 +6,7 @@ jobs: - '{project-name}-{stream}-verify-java' - '{project-name}-{stream}-merge-java' + - '{project-name}-{stream}-release-java-daily' project: 'appc' stream: diff --git a/jjb/dcae/apod-cdap.yaml b/jjb/dcae/apod-cdap.yaml new file mode 100644 index 000000000..6dbccca2b --- /dev/null +++ b/jjb/dcae/apod-cdap.yaml @@ -0,0 +1,32 @@ +--- + +- project: + name: dcae-apod-cdap + project-name: 'dcae-apod-cdap' + jobs: + - '{project-name}-{stream}-two-scm-verify-script' + + + # script: build script to execute + # extra-project: extra gerrit project to checkout + # extra-refspec: refspec for the extra project + # extra-branch: branch to checkout for the extra project + # checkout-dir: directory to checkout the extra project to + # DO NOT SET THIS TO anything that translates to + # $WORKSPACE as it will destroy the initial + # project checkout + + project: 'dcae/apod/cdap' + stream: + - 'master': + branch: 'master' + mvn-settings: 'dcae-apod-cdap-settings' + files: '**' + archive-artifacts: '' + build-node: ubuntu1604-basebuild-4c-4g + extra-project: 'dcae/apod/buildtools' + extra-branch: 'master' + extra-refspec: 'refs/heads/{branch}' + checkout-dir: 'dcae-apod-buildtools' + script: + !include-raw-escape: 'include-raw-apod-cdap.sh' diff --git a/jjb/dcae/dcae-controller-analytics.yaml b/jjb/dcae/dcae-controller-analytics.yaml index dcfac4407..be54386d6 100644 --- a/jjb/dcae/dcae-controller-analytics.yaml +++ b/jjb/dcae/dcae-controller-analytics.yaml @@ -11,7 +11,7 @@ stream: - 'master': branch: 'master' - mvn-settings: 'dcae-settings' + mvn-settings: 'dcae-controller-analytics-settings' # due to a strange macro / variable translation problem this needs to be # passed as a string block to properly get the properties correctly defined # in the job diff --git a/jjb/dcae/dcae-controller.yaml b/jjb/dcae/dcae-controller.yaml index 0e082ee71..176821b36 100644 --- a/jjb/dcae/dcae-controller.yaml +++ b/jjb/dcae/dcae-controller.yaml @@ -11,7 +11,7 @@ stream: - 'master': branch: 'master' - mvn-settings: 'dcae-settings' + mvn-settings: 'dcae-controller-settings' # due to a strange macro / variable translation problem this needs to be # passed as a string block to properly get the properties correctly defined # in the job diff --git a/jjb/dcae/dcae-operation-utils.yaml b/jjb/dcae/dcae-operation-utils.yaml index 182163ecb..035ee4a84 100644 --- a/jjb/dcae/dcae-operation-utils.yaml +++ b/jjb/dcae/dcae-operation-utils.yaml @@ -15,7 +15,7 @@ stream: - 'master': branch: 'master' - mvn-settings: 'dcae-settings' + mvn-settings: 'dcae-operation-utils-settings' # due to a strange macro / variable translation problem this needs to be # passed as a string block to properly get the properties correctly defined # in the job diff --git a/jjb/dcae/include-raw-apod-cdap.sh b/jjb/dcae/include-raw-apod-cdap.sh new file mode 100644 index 000000000..d87b49ad0 --- /dev/null +++ b/jjb/dcae/include-raw-apod-cdap.sh @@ -0,0 +1,91 @@ +#!/bin/bash +# Create a debian package and push to remote repo +# + +echo '===================== STARTING SCRIPT TO CREATE DEBIAN FILE =======================' +# Extract the username, password and path to the nexus repo from the maven settings file +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") +OPENECOMP_NEXUS_REPO="${NEXUSPROXY}/content/sites/raw" + +#Create a netrc file for use with curl +NETRC=$(mktemp) +echo "machine nexus.openecomp.org login $USER password $PASS" > "$NETRC" + + +#Write an envionment var for the netrc location since it's a temp file +echo "NETRC=$NETRC" > "$WORKSPACE/netrc_env.txt" + +STAGE_DIR=${WORKSPACE}/package +OUTPUT_DIR=${WORKSPACE}/package/output + +DATE_STAMP="$(date +"%Y%m%d%H%M%S")" +PACKAGE_BUILD_NUMBER=${DATE_STAMP} +PACKAGE_NAME_APPLICATION=$( \ + cat ${WORKSPACE}/dcae-apod-buildtools/configs/package-cdap3vm.json | \ + python -c 'import json,sys;print json.load(sys.stdin)["applicationName"]') +PACKAGE_NAME_VERSION=$( \ + cat ${WORKSPACE}/dcae-apod-buildtools/configs/package-cdap3vm.json | \ + python -c 'import json,sys;print json.load(sys.stdin)["version"]') +PACKAGE_GROUP_ID=$( \ + cat ${WORKSPACE}/dcae-apod-buildtools/configs/package-cdap3vm.json | \ + python -c 'import json,sys;print json.load(sys.stdin)["groupId"]') +OUTPUT_FILE="${PACKAGE_NAME_APPLICATION}_${PACKAGE_NAME_VERSION}.deb" +OUTPUT_FILE_DATE_STAMPED= \ + "${PACKAGE_NAME_APPLICATION}_${PACKAGE_NAME_VERSION}-${DATE_STAMP}.deb" + +echo 'Package variables:' +echo " STAGE_DIR = ${STATE_DIR}" +echo " OUTPUT_DIR = ${OUTPUT_DIR}" +echo " PACKAGE_BUILD_NUMBER = ${PACKAGE_BUILD_NUMBER}" +echo " PACKAGE_NAME_APPLICATION = ${PACKAGE_NAME_APPLICATION}" +echo " PACKAGE_NAME_VERSION = ${PACKAGE_NAME_VERSION}" +echo " PACKAGE_GROUP_ID = ${PACKAGE_GROUP_ID}" +echo " OUTPUT_FILE = ${OUTPUT_FILE}" +echo " OUTPUT_FILE_DATE_STAMPED = ${OUTPUT_FILE_DATE_STAMPED}" + +echo 'Creating Staging and Output directories' +rm -rf ${STAGE_DIR} +rm -rf ${OUTPUT_DIR} +mkdir -p ${STAGE_DIR}/stage/opt/app/dcae-cdap-small-hadoop +mkdir -p ${OUTPUT_DIR} + +echo 'Copying files to stage' +cp -R ${WORKSPACE}/cdap3vm/* ${STAGE_DIR}/stage/opt/app/dcae-cdap-small-hadoop + +echo 'Copying json file to stage' +cp ${WORKSPACE}/dcae-apod-buildtools/configs/package-cdap3vm.json ${STAGE_DIR}/package.json + +echo 'Contents of stage directory' +ls -lR ${STAGE_DIR} + +echo "Creating debian package" +${WORKSPACE}/dcae-apod-buildtools/scripts/package -b debian -d ${STAGE_DIR} \ + -o ${OUTPUT_DIR} -y package.json -B ${PACKAGE_BUILD_NUMBER} -v + + +echo "Contents of output directory" +ls -lR ${OUTPUT_DIR} + +# The controller needs the debian packaged named +# dcae-cdap-small-hadoop_17.01.0-LATEST.deb so it can find and deploy it. +# In order to have a copy of each file built a copy of +# dcae-cdap-small-hadoop_17.01.0-LATEST.deb will be made and it will have a +# date stamp and build number on it. +# For example: dcae-cda-small-hadoop_17.01.0-YYYYMMDDHHMMSS-XXX.deb +# Both files will then be uploaded to the repository. + +cp ${OUTPUT_DIR}/${OUTPUT_FILE_DATE_STAMPED} ${OUTPUT_DIR}/${OUTPUT_FILE} + +SEND_TO= \ +"${OPENECOMP_NEXUS_REPO}/org.openecomp.dcae.apod.cdap/deb-snapshots/${PACKAGE_GROUP_ID}/${OUTPUT_FILE}" +echo "Sending ${OUTPUT_DIR}/${OUTPUT_FILE} to Nexus Repo: ${SEND_TO}" +curl -vkn --netrc-file "${NETRC}" --upload-file ${OUTPUT_DIR}/${OUTPUT_FILE} ${SEND_TO} + +SEND_TO= \ +"${OPENECOMP_NEXUS_REPO}/org.openecomp.dcae.apod.cdap/deb-snapshots/${PACKAGE_GROUP_ID}/${OUTPUT_FILE_DATE_STAMPED}" + +echo "Sending ${OUTPUT_DIR}/${OUTPUT_FILE_DATE_STAMPED} to Nexus Repo: ${SEND_TO}" +curl -vkn --netrc-file "${NETRC}" --upload-file ${OUTPUT_DIR}/${OUTPUT_FILE_DATE_STAMPED} ${SEND_TO} + +echo '===================== ENDING SCRIPT TO CREATE DEBIAN FILE =======================' diff --git a/jjb/global-macros.yaml b/jjb/global-macros.yaml index f7e147297..460bb3ad4 100644 --- a/jjb/global-macros.yaml +++ b/jjb/global-macros.yaml @@ -311,6 +311,24 @@ - compare-type: 'ANT' pattern: '{files}' +- trigger: + name: gerrit-trigger-release-manually + triggers: + - gerrit: + server-name: '{server}' + trigger-on: + - comment-added-contains-event: + comment-contains-value: 'please release' + projects: + - project-compare-type: 'ANT' + project-pattern: '{project}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + file-paths: + - compare-type: 'ANT' + pattern: '**' + # WRAPPERS - wrapper: name: build-timeout diff --git a/jjb/global-templates-java.yaml b/jjb/global-templates-java.yaml index f080a4854..27c973109 100644 --- a/jjb/global-templates-java.yaml +++ b/jjb/global-templates-java.yaml @@ -216,6 +216,66 @@ triggers: # 11 AM UTC - timed: 'H 11 * * *' + - gerrit-trigger-release-manually: + server: '{server-name}' + project: '{project}' + branch: '{branch}' + + builders: + - provide-maven-settings: + global-settings-file: 'global-settings' + settings-file: '{mvn-settings}' + + - maven-target: + maven-version: 'mvn33' + goals: 'clean deploy sonar:sonar -Dsonar.host.url=https://sonar.openecomp.org' + properties: + - '{maven-deploy-properties}' + settings: '{mvn-settings}' + settings-type: cfp + global-settings: 'global-settings' + global-settings-type: cfp + +- job-template: + # Job template for Java daily release jobs + # + # The purpose of this job template is to run "maven version && maven clean + # deploy" for projects using this template. + # + # Required Variables: + # branch: git branch (eg. stable/lithium or master) + name: '{project-name}-{stream}-release-version-java-daily' + + project-type: freestyle + node: '{build-node}' + maven-deploy-properties: + properties: + - ecomp-infra-properties: + build-days-to-keep: '{build-days-to-keep}' + + parameters: + - ecomp-infra-parameters: + project: '{project}' + branch: '{branch}' + refspec: 'refs/heads/{branch}' + artifacts: '{archive-artifacts}' + + scm: + - gerrit-trigger-scm: + refspec: '' + choosing-strategy: 'default' + + wrappers: + - ecomp-infra-wrappers: + build-timeout: '{build-timeout}' + + triggers: + # 11 AM UTC + - timed: 'H 11 * * *' + - gerrit-trigger-release-manually: + server: '{server-name}' + project: '{project}' + branch: '{branch}' builders: - provide-maven-settings: @@ -283,6 +343,10 @@ triggers: # 11 AM UTC - timed: 'H 11 * * *' + - gerrit-trigger-release-manually: + server: '{server-name}' + project: '{project}' + branch: '{branch}' builders: - provide-maven-settings: @@ -358,6 +422,68 @@ # maven-version: 'mvn33' - job-template: + # Job template for Java merge jobs that should also be triggered by upstream + # merges + # + # Required Variables: + # stream: release stream + # branch: git branch + # dependencies: fully qualified upstream job name to trigger on + # this may be '' + name: '{project-name}-{stream}-downstream-merge-java' + + project-type: freestyle + node: '{build-node}' + + properties: + - ecomp-infra-properties: + build-days-to-keep: '{build-days-to-keep}' + + parameters: + - ecomp-infra-parameters: + project: '{project}' + branch: '{branch}' + refspec: 'refs/heads/{branch}' + artifacts: '{archive-artifacts}' + + scm: + - gerrit-trigger-scm: + refspec: '' + choosing-strategy: 'default' + + wrappers: + - ecomp-infra-wrappers: + build-timeout: '{build-timeout}' + + triggers: + - reverse: + jobs: '{dependencies}' + result: 'success' + - gerrit-trigger-patch-merged: + server: '{server-name}' + project: '{project}' + branch: '{branch}' + files: '**' + + builders: + - provide-maven-settings: + global-settings-file: 'global-settings' + settings-file: '{mvn-settings}' + - maven-target: + maven-version: 'mvn33' + # yamllint disable rule:line-length + goals: 'clean deploy' + # yamllint enable + settings: '{mvn-settings}' + settings-type: cfp + global-settings: 'global-settings' + global-settings-type: cfp + +# publishers: +# - ecomp-infra-shiplogs: +# maven-version: 'mvn33' + +- job-template: # Job template for Java merge jobs with POM not at the root # # The purpose of this job template is to run "maven clean deploy" for @@ -446,8 +572,12 @@ build-timeout: '{build-timeout}' triggers: - # 11 AM UTC + # 12 AM UTC - timed: 'H 12 * * *' + - gerrit-trigger-release-manually: + server: '{server-name}' + project: '{project}' + branch: '{branch}' builders: diff --git a/jjb/mso/mso-libs.yaml b/jjb/mso/mso-libs.yaml index 99c25d425..e44632a11 100644 --- a/jjb/mso/mso-libs.yaml +++ b/jjb/mso/mso-libs.yaml @@ -5,7 +5,7 @@ jobs: - '{project-name}-{stream}-verify-java' - '{project-name}-{stream}-merge-java' - - '{project-name}-{stream}-release-java-daily' + - '{project-name}-{stream}-release-version-java-daily' project: 'mso/libs' stream: diff --git a/jjb/mso/mso.yaml b/jjb/mso/mso.yaml index 2628fecb1..ae78a4d82 100644 --- a/jjb/mso/mso.yaml +++ b/jjb/mso/mso.yaml @@ -6,7 +6,7 @@ jobs: - '{project-name}-{stream}-verify-java' - '{project-name}-{stream}-merge-java' - - '{project-name}-{stream}-release-java-daily' + - '{project-name}-{stream}-release-version-java-daily' - '{project-name}-{stream}-docker-java-daily': docker-pom: 'pom.xml' mvn-profile: 'docker' diff --git a/jjb/ncomp/ncomp-cdap.yaml b/jjb/ncomp/ncomp-cdap.yaml index ec56af821..6b3f4f74e 100644 --- a/jjb/ncomp/ncomp-cdap.yaml +++ b/jjb/ncomp/ncomp-cdap.yaml @@ -11,7 +11,7 @@ stream: - 'master': branch: 'master' - mvn-settings: 'ncomp-settings' + mvn-settings: 'ncomp-cdap-settings' # due to a strange macro / variable translation problem this needs to be # passed as a string block to properly get the properties correctly defined # in the job diff --git a/jjb/ncomp/ncomp-core.yaml b/jjb/ncomp/ncomp-core.yaml index 894972818..675e7ad67 100644 --- a/jjb/ncomp/ncomp-core.yaml +++ b/jjb/ncomp/ncomp-core.yaml @@ -11,7 +11,7 @@ stream: - 'master': branch: 'master' - mvn-settings: 'ncomp-settings' + mvn-settings: 'ncomp-core-settings' # due to a strange macro / variable translation problem this needs to be # passed as a string block to properly get the properties correctly defined # in the job diff --git a/jjb/ncomp/ncomp-docker.yaml b/jjb/ncomp/ncomp-docker.yaml index ba0c12b3a..6603b16ad 100644 --- a/jjb/ncomp/ncomp-docker.yaml +++ b/jjb/ncomp/ncomp-docker.yaml @@ -11,7 +11,7 @@ stream: - 'master': branch: 'master' - mvn-settings: 'ncomp-settings' + mvn-settings: 'ncomp-docker-settings' # due to a strange macro / variable translation problem this needs to be # passed as a string block to properly get the properties correctly defined # in the job diff --git a/jjb/ncomp/ncomp-maven.yaml b/jjb/ncomp/ncomp-maven.yaml index 9a1d2ad62..2bc55d425 100644 --- a/jjb/ncomp/ncomp-maven.yaml +++ b/jjb/ncomp/ncomp-maven.yaml @@ -11,7 +11,7 @@ stream: - 'master': branch: 'master' - mvn-settings: 'ncomp-settings' + mvn-settings: 'ncomp-maven-settings' # due to a strange macro / variable translation problem this needs to be # passed as a string block to properly get the properties correctly defined # in the job diff --git a/jjb/ncomp/ncomp-openstack.yaml b/jjb/ncomp/ncomp-openstack.yaml index eb9272f9d..e2a02074d 100644 --- a/jjb/ncomp/ncomp-openstack.yaml +++ b/jjb/ncomp/ncomp-openstack.yaml @@ -11,7 +11,7 @@ stream: - 'master': branch: 'master' - mvn-settings: 'ncomp-settings' + mvn-settings: 'ncomp-openstack-settings' # due to a strange macro / variable translation problem this needs to be # passed as a string block to properly get the properties correctly defined # in the job diff --git a/jjb/ncomp/ncomp-sirius-manager.yaml b/jjb/ncomp/ncomp-sirius-manager.yaml index 86cf77152..f33fa95b2 100644 --- a/jjb/ncomp/ncomp-sirius-manager.yaml +++ b/jjb/ncomp/ncomp-sirius-manager.yaml @@ -11,7 +11,7 @@ stream: - 'master': branch: 'master' - mvn-settings: 'ncomp-settings' + mvn-settings: 'ncomp-sirius-manager-settings' # due to a strange macro / variable translation problem this needs to be # passed as a string block to properly get the properties correctly defined # in the job diff --git a/jjb/ncomp/ncomp-utils.yaml b/jjb/ncomp/ncomp-utils.yaml index d2c2b3fce..0efcb1f45 100644 --- a/jjb/ncomp/ncomp-utils.yaml +++ b/jjb/ncomp/ncomp-utils.yaml @@ -4,14 +4,15 @@ project-name: 'ncomp-utils' jobs: - '{project-name}-{stream}-verify-java' - - '{project-name}-{stream}-merge-java' + - '{project-name}-{stream}-downstream-merge-java': + dependencies: 'ncomp-master-merge-java' - '{project-name}-{stream}-release-java-daily' project: 'ncomp/utils' stream: - 'master': branch: 'master' - mvn-settings: 'ncomp-settings' + mvn-settings: 'ncomp-utils-settings' # due to a strange macro / variable translation problem this needs to be # passed as a string block to properly get the properties correctly defined # in the job |