summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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