summaryrefslogtreecommitdiffstats
path: root/build/build_nexus_blob.sh
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2020-10-22 15:35:10 +0200
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2020-10-26 10:28:02 +0000
commit579bdb2178700a6c7e684066d6526292a32cf130 (patch)
tree24546ce90e26004c1192baf22920bf62f45408b9 /build/build_nexus_blob.sh
parent65b9384075832ba18642fb51fed1349f2f654234 (diff)
Support publishing exposed container ports on custom host ports
Change-Id: I3dcd47932821a124906f8d125697ecbe21c259af Issue-ID: OOM-2605 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'build/build_nexus_blob.sh')
-rwxr-xr-xbuild/build_nexus_blob.sh16
1 files changed, 13 insertions, 3 deletions
diff --git a/build/build_nexus_blob.sh b/build/build_nexus_blob.sh
index 47190d0b..004528d8 100755
--- a/build/build_nexus_blob.sh
+++ b/build/build_nexus_blob.sh
@@ -38,8 +38,10 @@ exec &> >(tee -a "${SCRIPT_LOG}")
# Nexus repository properties
NEXUS_DOMAIN="nexus"
NEXUS_HOST="127.0.0.1"
-NEXUS_PORT="8081"
-NEXUS_DOCKER_PORT="8082"
+NEXUS_EXPOSED_PORT="8081"
+NEXUS_PORT=${NEXUS_EXPOSED_PORT}
+NEXUS_DOCKER_EXPOSED_PORT="8082"
+NEXUS_DOCKER_PORT=${NEXUS_DOCKER_EXPOSED_PORT}
DEFAULT_REGISTRY="docker.io"
# Nexus repository credentials
@@ -96,6 +98,8 @@ usage () {
-p | --pypi use specific list of pypi packages to be pushed into Nexus
-rl | --resource-list-directory use specific directory with docker, pypi and npm lists
-c | --container-name use specific Nexus docker container name
+ -NP | --nexus-port use specific port for published Nexus service
+ -DP | --docker-port use specific port for published Nexus docker registry port
"
exit 1
}
@@ -223,6 +227,12 @@ while [ "${1}" != "" ]; do
-rl | --resource-list-directory ) shift
LISTS_DIR="$(realpath ${1})"
;;
+ -NP | --nexus-port ) shift
+ NEXUS_PORT="${1}"
+ ;;
+ -DP | --docker-port ) shift
+ NEXUS_DOCKER_PORT="${1}"
+ ;;
-h | --help ) usage
;;
*) usage
@@ -276,7 +286,7 @@ if [ -f ~/.docker/config.json ]; then
fi
# Setup default ports published to host as docker registry
-PUBLISHED_PORTS="-p ${NEXUS_PORT}:${NEXUS_PORT} -p ${NEXUS_DOCKER_PORT}:${NEXUS_DOCKER_PORT}"
+PUBLISHED_PORTS="-p ${NEXUS_PORT}:${NEXUS_EXPOSED_PORT} -p ${NEXUS_DOCKER_PORT}:${NEXUS_DOCKER_EXPOSED_PORT}"
# Nexus repository configuration setup
NEXUS_CONFIG_GROOVY='import org.sonatype.nexus.security.realm.RealmManager