From 89c3f94d528edde641b268e4e67a0c6a170a5b2e Mon Sep 17 00:00:00 2001 From: Ioakeim Samaras Date: Fri, 15 Nov 2019 12:20:15 -0800 Subject: [PATCH] [UI] Embed files inside image The files 'server.xml' and 'index.jsp' are embedded inside the UI docker image during build stage Signed-off-by: Ioakeim Samaras Change-Id: I056fbb28a2e58630061ea85d8846ebe08f302998 --- docker/ui/Dockerfile | 2 ++ docker/ui/deploy.sh | 4 ++-- ui/CHANGELOG.md | 10 +++++++++- docker/ui/root_index.jsp => ui/docker-files/index.jsp | 0 {docker/ui => ui/docker-files}/server.xml | 0 ui/pom.xml | 8 ++++---- ui/src/main/resources/portal.properties | 2 +- ui/ui-docker-assembly.xml | 10 ++++++++++ 8 files changed, 28 insertions(+), 8 deletions(-) rename docker/ui/root_index.jsp => ui/docker-files/index.jsp (100%) rename {docker/ui => ui/docker-files}/server.xml (100%) create mode 100644 ui/ui-docker-assembly.xml diff --git a/docker/ui/Dockerfile b/docker/ui/Dockerfile index c7a6a5e..0ef94f6 100644 --- a/docker/ui/Dockerfile +++ b/docker/ui/Dockerfile @@ -20,3 +20,5 @@ RUN cd /opt/akraino/validation/ui && mvn clean package FROM tomcat:8.5.37 COPY --from=build /opt/akraino/validation/ui/target/bluvalui.war /usr/local/tomcat/webapps +COPY --from=build /opt/akraino/validation/ui/docker-files/index.jsp /usr/local/tomcat/webapps/ROOT +COPY --from=build /opt/akraino/validation/ui/docker-files/server.xml /usr/local/tomcat/conf diff --git a/docker/ui/deploy.sh b/docker/ui/deploy.sh index 6a0d58f..8c9a231 100755 --- a/docker/ui/deploy.sh +++ b/docker/ui/deploy.sh @@ -76,8 +76,8 @@ echo "Note: If there is a password already stored in database, the supplied UI_A IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$TAG_VER" if [[ $USE_NETWORK_HOST = "true" ]] then - docker run --detach --name $CONTAINER_NAME --network="host" -v "$(pwd)/server.xml:/usr/local/tomcat/conf/server.xml" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -v "$(pwd)/root_index.jsp:/usr/local/tomcat/webapps/ROOT/index.jsp" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e TRUST_ALL="$TRUST_ALL" $IMAGE + docker run --detach --name $CONTAINER_NAME --network="host" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e TRUST_ALL="$TRUST_ALL" $IMAGE else - docker run --detach --name $CONTAINER_NAME -v "$(pwd)/server.xml:/usr/local/tomcat/conf/server.xml" -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -v "$(pwd)/root_index.jsp:/usr/local/tomcat/webapps/ROOT/index.jsp" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e TRUST_ALL="$TRUST_ALL" $IMAGE + docker run --detach --name $CONTAINER_NAME -v "$CERTDIR/bluval.key:/usr/local/tomcat/bluval.key" -v "$CERTDIR/bluval.crt:/usr/local/tomcat/bluval.crt" -e DB_IP_PORT="$DB_IP_PORT" -e MYSQL_USER="$MYSQL_USER" -e MYSQL_PASSWORD="$MYSQL_PASSWORD" -e JENKINS_URL="$JENKINS_URL" -e JENKINS_USERNAME="$JENKINS_USERNAME" -e JENKINS_USER_PASSWORD="$JENKINS_USER_PASSWORD" -e JENKINS_JOB_NAME="$JENKINS_JOB_NAME" -e NEXUS_PROXY="$NEXUS_PROXY" -e JENKINS_PROXY="$JENKINS_PROXY" -e ENCRYPTION_KEY="$ENCRYPTION_KEY" -e UI_ADMIN_PASSWORD="$UI_ADMIN_PASSWORD" -e TRUST_ALL="$TRUST_ALL" $IMAGE fi sleep 10 diff --git a/ui/CHANGELOG.md b/ui/CHANGELOG.md index bea59b6..6983f2e 100644 --- a/ui/CHANGELOG.md +++ b/ui/CHANGELOG.md @@ -234,7 +234,7 @@ All notable changes to this project will be documented in this file. ### Removed -## [0.4.4-SNAPSHOT] - 4 October 2019 +## [0.4.4-SNAPSHOT] - 4 October 2019 - Tagged as 2.0.0 ### Added - The user can define whether the UI can trust all SSL certificates or not. - The mysql user name can be configured. @@ -243,3 +243,11 @@ All notable changes to this project will be documented in this file. - New approach is used for interpreting shell script input variables. Now, all symbols are recognized. ### Removed + +## [0.4.5-SNAPSHOT] - 15 November 2019 +### Added + +### Changed +- The files 'server.xml' and index.jsp are embedded inside the UI docker image during build stage + +### Removed diff --git a/docker/ui/root_index.jsp b/ui/docker-files/index.jsp similarity index 100% rename from docker/ui/root_index.jsp rename to ui/docker-files/index.jsp diff --git a/docker/ui/server.xml b/ui/docker-files/server.xml similarity index 100% rename from docker/ui/server.xml rename to ui/docker-files/server.xml diff --git a/ui/pom.xml b/ui/pom.xml index d69dbd2..281781e 100644 --- a/ui/pom.xml +++ b/ui/pom.xml @@ -14,7 +14,7 @@ org.akraino.validation ui - 0.4.4-SNAPSHOT + 0.4.5-SNAPSHOT Bluval UI Maven Webapp war @@ -159,19 +159,19 @@ tomcat:8.5.37 - artifact + ${project.basedir}/ui-docker-assembly.xml - + akraino/validation:dev-mysql-latest - mysql:5.6 + mysql:5.6ll project diff --git a/ui/src/main/resources/portal.properties b/ui/src/main/resources/portal.properties index d870e02..e10f136 100644 --- a/ui/src/main/resources/portal.properties +++ b/ui/src/main/resources/portal.properties @@ -56,7 +56,7 @@ use_rest_for_functional_menu=true portal.api.impl.class = org.onap.portalapp.service.OnBoardingApiServiceImpl # URL of the Portal where this app is onboarded -ecomp_redirect_url = https://bluval.akraino.org:8443/bluvalui/ +ecomp_redirect_url = https://bluval.akraino.org:443/bluvalui/ # URL of the ECOMP Portal REST API ecomp_rest_url = http://portal.onap.org:50580/ecompportal/auxapi diff --git a/ui/ui-docker-assembly.xml b/ui/ui-docker-assembly.xml new file mode 100644 index 0000000..9031f76 --- /dev/null +++ b/ui/ui-docker-assembly.xml @@ -0,0 +1,10 @@ + + ui-docker + + + . + . + 0644 + + + \ No newline at end of file -- 2.16.6