summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Grimberg <agrimberg@linuxfoundation.org>2017-03-09 16:03:16 +0000
committerGerrit Code Review <gerrit@openecomp.org>2017-03-09 16:03:16 +0000
commit67fee1f6a9f0439f30dd7960cb651cf4f55c5959 (patch)
tree8600b5145d2a9fba56569b2327f943acb90b2678
parentf8f1e2a8a766cd5133ba8289eacba6a097513a29 (diff)
parenta247e9f6f260b463f50fb5af072be9e25c7aec3f (diff)
Merge "new job to release docker images"
-rw-r--r--jjb/global-templates-script.yaml39
-rwxr-xr-xjjb/include-docker-blessing.sh28
-rw-r--r--jjb/mso/mso.yaml1
3 files changed, 68 insertions, 0 deletions
diff --git a/jjb/global-templates-script.yaml b/jjb/global-templates-script.yaml
index dd0cd0f1a..83f4fe6a2 100644
--- a/jjb/global-templates-script.yaml
+++ b/jjb/global-templates-script.yaml
@@ -862,3 +862,42 @@
# publishers:
# - ecomp-infra-shiplogs:
# maven-version: '{maven-version}'
+
+- job-template:
+ # 1. PULL the desired image
+ # 2. TAG it to the desired release name
+ # 3. PUSH the newly tagged image on release repo
+
+ name: '{project-name}-docker-image-blessing'
+
+ project-type: freestyle
+ concurrent: true
+ node: 'ubuntu1604-docker-2c-1g'
+
+ parameters:
+ - string:
+ name: VERSION
+ description: "VERSION of the STAGING image to bless into this RELEASE VERSION
+ Example : 1.2.3"
+ - string:
+ name: TIMESTAMP
+ description: "TIMESTAMP of the STAGING image to pull
+ Example : 20170308T1332"
+ - string:
+ name: PROJECT
+ default: '{project}'
+
+ properties:
+ - ecomp-infra-properties:
+ build-days-to-keep: '{build-days-to-keep}'
+
+ wrappers:
+ - ecomp-infra-wrappers:
+ build-timeout: '{build-timeout}'
+
+ builders:
+ - provide-maven-settings:
+ global-settings-file: 'global-settings'
+ settings-file: '{mvn-settings}'
+ - docker-login
+ - shell: !include-raw: include-docker-blessing.sh \ No newline at end of file
diff --git a/jjb/include-docker-blessing.sh b/jjb/include-docker-blessing.sh
new file mode 100755
index 000000000..3cb67cf95
--- /dev/null
+++ b/jjb/include-docker-blessing.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+if [ -z "$VERSION" ];
+then
+ echo "Error: no version provided"
+ exit 1
+fi
+
+if [ -z "$TIMESTAMP" ];
+then
+ echo "Error: no timestamp provided"
+ exit 1
+fi
+
+if [ -z "$PROJECT" ];
+then
+ echo "Error: no project provided"
+ exit 1
+fi
+
+RELEASE_REPOSITORY="nexus3.openecomp.org:10002"
+SNAPSHOT_REPOSITORY="nexus3.openecomp.org:10003"
+STAGING_IMAGE="openecomp/$PROJECT:$VERSION-STAGING-$TIMESTAMP"
+RELEASE_IMAGE="openecomp/$PROJECT:$VERSION"
+
+docker pull "$SNAPSHOT_REPOSITORY/$STAGING_IMAGE"
+docker tag "$SNAPSHOT_REPOSITORY/$STAGING_IMAGE" "$RELEASE_REPOSITORY/$RELEASE_IMAGE"
+docker push "$RELEASE_REPOSITORY/$RELEASE_IMAGE" \ No newline at end of file
diff --git a/jjb/mso/mso.yaml b/jjb/mso/mso.yaml
index ae78a4d82..b577194b7 100644
--- a/jjb/mso/mso.yaml
+++ b/jjb/mso/mso.yaml
@@ -10,6 +10,7 @@
- '{project-name}-{stream}-docker-java-daily':
docker-pom: 'pom.xml'
mvn-profile: 'docker'
+ - '{project-name}-docker-image-blessing'
project: 'mso'
stream: