summaryrefslogtreecommitdiffstats
path: root/jjb
diff options
context:
space:
mode:
authorAndrew Grimberg <agrimberg@linuxfoundation.org>2017-02-15 14:12:35 +0000
committerGerrit Code Review <gerrit@openecomp.org>2017-02-15 14:12:35 +0000
commita72bf79b5c3b05a2781fcde61893a9591d21b664 (patch)
tree283570c85fea2cd599e182c3d5d6dc293d6191af /jjb
parentfa3a4dbc77a8ccb54f9fd0e3dc8d2b302cbad3cc (diff)
parent63e090e8af3609560cb0c0bb98391efa4c11954b (diff)
Merge "Perform docker login before pusing images"
Diffstat (limited to 'jjb')
-rw-r--r--jjb/global-macros.yaml5
-rw-r--r--jjb/global-templates-java.yaml3
-rw-r--r--jjb/include-docker-login.sh12
3 files changed, 20 insertions, 0 deletions
diff --git a/jjb/global-macros.yaml b/jjb/global-macros.yaml
index 43f52f46c..5815ccf53 100644
--- a/jjb/global-macros.yaml
+++ b/jjb/global-macros.yaml
@@ -52,6 +52,11 @@
- docker.pull.registry=nexus3.openecomp.org:10001
- docker.push.registry=nexus3.openecomp.org:10003
+- builder:
+ name: docker-login
+ builders:
+ - shell: !include-raw: include-docker-login.sh
+
# PARAMETERS
- parameter:
name: ecomp-infra-parameters
diff --git a/jjb/global-templates-java.yaml b/jjb/global-templates-java.yaml
index a9a368ee2..e11a658a9 100644
--- a/jjb/global-templates-java.yaml
+++ b/jjb/global-templates-java.yaml
@@ -334,10 +334,13 @@
- timed: 'H 12 * * *'
builders:
+
- provide-maven-settings:
global-settings-file: 'global-settings'
settings-file: '{mvn-settings}'
+ - docker-login
+
- maven-docker-push-daily:
mvn-settings: '{mvn-settings}'
pom: '{docker-pom}'
diff --git a/jjb/include-docker-login.sh b/jjb/include-docker-login.sh
new file mode 100644
index 000000000..f583f73f2
--- /dev/null
+++ b/jjb/include-docker-login.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+DOCKER_REPOSITORIES=nexus3.openecomp.org:10001 \
+ nexus3.openecomp.org:10002 \
+ nexus3.openecomp.org:10003
+
+for DOCKER_REPOSITORY in $DOCKER_REPOSITORIES;
+do
+ USER=$(xpath -q -e "//servers/server[id='$DOCKER_REPOSITORY']/username/text()" "$SETTINGS_FILE")
+ PASS=$(xpath -q -e "//servers/server[id='$DOCKER_REPOSITORY']/password/text()" "$SETTINGS_FILE")
+ docker login $DOCKER_REPOSITORY -u $USER -p $PASS
+done