3 # Copyright (c) 2019 AT&T Intellectual Property. All other rights reserved.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
20 CONTAINER_NAME="akraino-validation-ui"
26 # Container input parameters
27 MYSQL_AKRAINO_PASSWORD=""
28 JENKINS_URL="https://jenkins.akraino.org/"
29 JENKINS_USERNAME="demo"
30 JENKINS_USER_PASSWORD="demo"
31 JENKINS_JOB_NAME="validation"
41 KEY=$(echo $ARGUMENT | cut -f1 -d=)
42 VALUE=$(echo $ARGUMENT | cut -f2 -d=)
44 REGISTRY) REGISTRY=${VALUE} ;;
45 NAME) NAME=${VALUE} ;;
46 TAG_PRE) TAG_PRE=${VALUE} ;;
47 TAG_VER) TAG_VER=${VALUE} ;;
48 MYSQL_AKRAINO_PASSWORD) MYSQL_AKRAINO_PASSWORD=${VALUE} ;;
49 JENKINS_URL) JENKINS_URL=${VALUE} ;;
50 JENKINS_USERNAME) JENKINS_USERNAME=${VALUE} ;;
51 JENKINS_USER_PASSWORD) JENKINS_USER_PASSWORD=${VALUE} ;;
52 JENKINS_JOB_NAME) JENKINS_JOB_NAME=${VALUE} ;;
53 DB_IP_PORT) DB_IP_PORT=${VALUE} ;;
54 CONTAINER_NAME) CONTAINER_NAME=${VALUE} ;;
55 NEXUS_PROXY) NEXUS_PROXY=${VALUE} ;;
56 JENKINS_PROXY) JENKINS_PROXY=${VALUE} ;;
57 CERTDIR) CERTDIR=${VALUE} ;;
58 ENCRYPTION_KEY) ENCRYPTION_KEY=${VALUE} ;;
59 UI_ADMIN_PASSWORD) UI_ADMIN_PASSWORD=${VALUE} ;;
64 if [ -z "$DB_IP_PORT" ]
66 echo "ERROR: You must specify the database IP and port"
70 if [ -z "$MYSQL_AKRAINO_PASSWORD" ]
72 echo "ERROR: You must specify the mysql akraino user password"
76 if [ -z "$ENCRYPTION_KEY" ]
78 echo "ERROR: You must specify the encryption key"
82 if [ -z "$UI_ADMIN_PASSWORD" ]
84 echo "ERROR: You must specify the UI admin password"
88 echo "Note: If there is a password already stored in database, the supplied UI_ADMIN_PASSWORD will be ignored."
90 IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$TAG_VER"
91 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_AKRAINO_PASSWORD="$MYSQL_AKRAINO_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" $IMAGE