summaryrefslogtreecommitdiffstats
path: root/deliveries
diff options
context:
space:
mode:
authorSunder Tattavarada <statta@research.att.com>2020-02-26 15:28:02 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-26 15:28:02 +0000
commita03dfa273ef6e196bf65acc54b9357d35eb0ed5e (patch)
tree9445256604dd9acd97337d61339fd95b69be045e /deliveries
parent751a5e5776b4615c8d3333f7b7d37d17bbf775ba (diff)
parent8e83c25788017acd56271a72286f7dcbc974e76d (diff)
Merge "Changes made to upgrade pom version"
Diffstat (limited to 'deliveries')
-rw-r--r--deliveries/.env2
-rw-r--r--deliveries/Dockerfile.mariadb10
-rw-r--r--deliveries/Dockerfile.widgetms5
-rwxr-xr-xdeliveries/os_docker_base.sh102
-rwxr-xr-xdeliveries/os_docker_push.sh5
-rwxr-xr-xdeliveries/os_docker_release.sh5
6 files changed, 88 insertions, 41 deletions
diff --git a/deliveries/.env b/deliveries/.env
index c5961d33..47a0924f 100644
--- a/deliveries/.env
+++ b/deliveries/.env
@@ -18,7 +18,7 @@ SDK_WAR_DIR=sdk/ecomp-sdk/epsdk-app-os/target
SDK_WAR_FILE=epsdk-app-os.war
BE_WAR_DIR=ecomp-portal-BE-os/target
BE_WAR_FILE=portal-be-os.war
-FE_DIR=ecomp-portal-FE-os/dist/public
+FE_DIR=portal-FE-os/dist/public
WIDGET_MS_JAR_DIR=ecomp-portal-widget-ms/widget-ms/target
WIDGET_MS_JAR_FILE=widget-ms.jar
diff --git a/deliveries/Dockerfile.mariadb b/deliveries/Dockerfile.mariadb
index 66fdc486..1506ec4f 100644
--- a/deliveries/Dockerfile.mariadb
+++ b/deliveries/Dockerfile.mariadb
@@ -8,7 +8,7 @@ COPY my.cnf /etc/mysql/my.cnf
# Scripts are executed in alphabetical order
-# Portal DDL and DML at v2.1
+# Portal DDL and DML at v2.6
COPY ${DB_SCRIPT_DIR}/PortalDDLMySql_2_6_Common.sql /docker-entrypoint-initdb.d/
COPY ${DB_SCRIPT_DIR}/PortalDDLMySql_2_6_OS.sql /docker-entrypoint-initdb.d/
COPY ${DB_SCRIPT_DIR}/PortalDMLMySql_2_6_Common.sql /docker-entrypoint-initdb.d/
@@ -16,7 +16,7 @@ COPY ${DB_SCRIPT_DIR}/PortalDMLMySql_2_6_OS.sql /docker-entrypoint-initdb.d/
# Do not copy the onboarding script here; it's mounted as a volume
# SDK App DDL and DML
-COPY ${DB_SCRIPT_DIR}/EcompSdkDDLMySql_2_6_Common.sql /docker-entrypoint-initdb.d/
-COPY ${DB_SCRIPT_DIR}/EcompSdkDDLMySql_2_6_OS.sql /docker-entrypoint-initdb.d/
-COPY ${DB_SCRIPT_DIR}/EcompSdkDMLMySql_2_6_Common.sql /docker-entrypoint-initdb.d/
-COPY ${DB_SCRIPT_DIR}/EcompSdkDMLMySql_2_6_OS.sql /docker-entrypoint-initdb.d/
+COPY ${DB_SCRIPT_DIR}/EcompSdkDDLMySql_2_5_Common.sql /docker-entrypoint-initdb.d/
+COPY ${DB_SCRIPT_DIR}/EcompSdkDDLMySql_2_5_OS.sql /docker-entrypoint-initdb.d/
+COPY ${DB_SCRIPT_DIR}/EcompSdkDMLMySql_2_5_Common.sql /docker-entrypoint-initdb.d/
+COPY ${DB_SCRIPT_DIR}/EcompSdkDMLMySql_2_5_OS.sql /docker-entrypoint-initdb.d/
diff --git a/deliveries/Dockerfile.widgetms b/deliveries/Dockerfile.widgetms
index 49c899ea..82a2e4c6 100644
--- a/deliveries/Dockerfile.widgetms
+++ b/deliveries/Dockerfile.widgetms
@@ -1,7 +1,8 @@
# Large image
# FROM openjdk:8-jdk
# Tiny image; it includes java and nc
-FROM openjdk:8-alpine
+#FROM frolvlad/alpine-oraclejdk8:slim
+FROM openjdk:8-jdk-alpine
# Arguments are supplied by build script;
# the defaults below only support testing
@@ -13,5 +14,7 @@ RUN sh -c 'touch /app.jar'
# Launch script
COPY start-wms.sh /
+RUN addgroup -g 1000 -S portal && adduser -u 1000 -S portal -G portal && mkdir logs / && chown -R portal:portal /start-wms.sh /tmp /etc/ssl/certs/java /logs && chmod -R 755 /start-wms.sh /etc/ssl/certs/java /logs /tmp
+
# Define default command
CMD /start-wms.sh
diff --git a/deliveries/os_docker_base.sh b/deliveries/os_docker_base.sh
index 94832ff5..b2a32a78 100755
--- a/deliveries/os_docker_base.sh
+++ b/deliveries/os_docker_base.sh
@@ -14,48 +14,86 @@ if [ -z "$LATEST" ]; then
exit 1
fi
-# ONAP docker registry for pushing; may need to move
-# this into os_docker_push, os_docker_release scripts
-NEXUS_REPO=nexus3.onap.org:10003
-
-# Build the containers
-./build_portalapps_dockers.sh
+# ONAP docker registry for pushing; has been moved to
+# .env (or other .env override file from command line)
+# NEXUS_REPO=nexus3.onap.org:10003
# Establish environment variables
source $(dirname $0)/.env
+if [ $1 ]; then
+ source $(dirname $0)/$1
+fi
+
+# Build the containers
+if [ "$SKIP_BUILD_BEFORE_PUSH" = "please" ]; then
+ echo "SKIPPING DOCKER IMAGE BUILD!"
+else
+ ./build_portalapps_dockers.sh $1
+fi
+
+if [ "${PORTAL_DOCKERFILE}" != "skip" ] && [ "${EP_IMG_NAME}" != "skip" ]; then
+ APP_VERSION="${NEXUS_REPO}/${EP_IMG_NAME}:${VERSION}"
+ APP_LATEST="${NEXUS_REPO}/${EP_IMG_NAME}:${LATEST}"
+
+ docker tag ${EP_IMG_NAME}:${PORTAL_TAG} ${APP_VERSION}
+ docker tag ${EP_IMG_NAME}:${PORTAL_TAG} ${APP_LATEST}
+
+ docker push ${APP_VERSION}
+ docker push ${APP_LATEST}
+fi
-APP_VERSION="${NEXUS_REPO}/${EP_IMG_NAME}:${VERSION}"
-SDK_VERSION="${NEXUS_REPO}/${SDK_IMG_NAME}:${VERSION}"
-DB_VERSION="${NEXUS_REPO}/${DB_IMG_NAME}:${VERSION}"
-WMS_VERSION="${NEXUS_REPO}/${WMS_IMG_NAME}:${VERSION}"
+if [ "${SDK_DOCKERFILE}" != "skip" ] && [ "${SDK_IMG_NAME}" != "skip" ]; then
+ SDK_VERSION="${NEXUS_REPO}/${SDK_IMG_NAME}:${VERSION}"
+ SDK_LATEST="${NEXUS_REPO}/${SDK_IMG_NAME}:${LATEST}"
-APP_LATEST="${NEXUS_REPO}/${EP_IMG_NAME}:${LATEST}"
-SDK_LATEST="${NEXUS_REPO}/${SDK_IMG_NAME}:${LATEST}"
-DB_LATEST="${NEXUS_REPO}/${DB_IMG_NAME}:${LATEST}"
-WMS_LATEST="${NEXUS_REPO}/${WMS_IMG_NAME}:${LATEST}"
+ docker tag ${SDK_IMG_NAME}:${PORTAL_TAG} ${SDK_VERSION}
+ docker tag ${SDK_IMG_NAME}:${PORTAL_TAG} ${SDK_LATEST}
-# tag versions
-docker tag ${EP_IMG_NAME}:${PORTAL_TAG} ${APP_VERSION}
-docker tag ${EP_IMG_NAME}:${PORTAL_TAG} ${APP_LATEST}
+ docker push ${SDK_VERSION}
+ docker push ${SDK_LATEST}
+fi
+
+if [ "${FE_DOCKERFILE}" != "skip" ] && [ "${FE_IMG_NAME}" != "skip" ]; then
+ FE_VERSION="${NEXUS_REPO}/${FE_IMG_NAME}:${VERSION}"
+ FE_LATEST="${NEXUS_REPO}/${FE_IMG_NAME}:${LATEST}"
+
+ docker tag ${FE_IMG_NAME}:${PORTAL_TAG} ${FE_VERSION}
+ docker tag ${FE_IMG_NAME}:${PORTAL_TAG} ${FE_LATEST}
-docker tag ${SDK_IMG_NAME}:${PORTAL_TAG} ${SDK_VERSION}
-docker tag ${SDK_IMG_NAME}:${PORTAL_TAG} ${SDK_LATEST}
+ docker push ${FE_VERSION}
+ docker push ${FE_LATEST}
+fi
-docker tag ${DB_IMG_NAME}:${PORTAL_TAG} ${DB_VERSION}
-docker tag ${DB_IMG_NAME}:${PORTAL_TAG} ${DB_LATEST}
+if [ "${BE_DOCKERFILE}" != "skip" ] && [ "${BE_IMG_NAME}" != "skip" ]; then
+ BE_VERSION="${NEXUS_REPO}/${BE_IMG_NAME}:${VERSION}"
+ BE_LATEST="${NEXUS_REPO}/${BE_IMG_NAME}:${LATEST}"
-docker tag ${WMS_IMG_NAME}:${PORTAL_TAG} ${WMS_VERSION}
-docker tag ${WMS_IMG_NAME}:${PORTAL_TAG} ${WMS_LATEST}
+ docker tag ${BE_IMG_NAME}:${PORTAL_TAG} ${BE_VERSION}
+ docker tag ${BE_IMG_NAME}:${PORTAL_TAG} ${BE_LATEST}
-# push to registry
-docker push ${APP_VERSION}
-docker push ${APP_LATEST}
+ docker push ${BE_VERSION}
+ docker push ${BE_LATEST}
+fi
-docker push ${SDK_VERSION}
-docker push ${SDK_LATEST}
+if [ "${DB_DOCKERFILE}" != "skip" ] && [ "${DB_IMG_NAME}" != "skip" ]; then
+ DB_VERSION="${NEXUS_REPO}/${DB_IMG_NAME}:${VERSION}"
+ DB_LATEST="${NEXUS_REPO}/${DB_IMG_NAME}:${LATEST}"
-docker push ${DB_VERSION}
-docker push ${DB_LATEST}
+ docker tag ${DB_IMG_NAME}:${PORTAL_TAG} ${DB_VERSION}
+ docker tag ${DB_IMG_NAME}:${PORTAL_TAG} ${DB_LATEST}
+
+ docker push ${DB_VERSION}
+ docker push ${DB_LATEST}
+fi
+
+if [ "${WMS_DOCKERFILE}" != "skip" ] && [ "${WMS_IMG_NAME}" != "skip" ]; then
+ WMS_VERSION="${NEXUS_REPO}/${WMS_IMG_NAME}:${VERSION}"
+ WMS_LATEST="${NEXUS_REPO}/${WMS_IMG_NAME}:${LATEST}"
+
+ docker tag ${WMS_IMG_NAME}:${PORTAL_TAG} ${WMS_VERSION}
+ docker tag ${WMS_IMG_NAME}:${PORTAL_TAG} ${WMS_LATEST}
+
+ docker push ${WMS_VERSION}
+ docker push ${WMS_LATEST}
+fi
-docker push ${WMS_VERSION}
-docker push ${WMS_LATEST}
diff --git a/deliveries/os_docker_push.sh b/deliveries/os_docker_push.sh
index 0978ad83..1d1f3293 100755
--- a/deliveries/os_docker_push.sh
+++ b/deliveries/os_docker_push.sh
@@ -6,6 +6,9 @@ set -x
# Establish environment variables
source $(dirname $0)/.env
+if [ $1 ]; then
+ source $(dirname $0)/$1
+fi
if [ -z "$PORTAL_VERSION" ]; then
echo "PORTAL_VERSION not set"
@@ -20,4 +23,4 @@ TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
export VERSION="${PORTAL_VERSION}-STAGING-${TIMESTAMP}"
export LATEST="${PORTAL_VERSION}-STAGING-latest"
-exec ./os_docker_base.sh
+./os_docker_base.sh $1
diff --git a/deliveries/os_docker_release.sh b/deliveries/os_docker_release.sh
index 3ff88b2d..1fb8a9a5 100755
--- a/deliveries/os_docker_release.sh
+++ b/deliveries/os_docker_release.sh
@@ -6,6 +6,9 @@ set -x
# Establish environment variables
source $(dirname $0)/.env
+if [ $1 ]; then
+ source $(dirname $0)/$1
+fi
if [ -z "$PORTAL_VERSION" ]; then
echo "PORTAL_VERSION not set"
@@ -16,4 +19,4 @@ TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
export VERSION="${PORTAL_VERSION}-${TIMESTAMP}"
export LATEST="${PORTAL_VERSION}"
-exec ./os_docker_base.sh
+./os_docker_base.sh $1