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.
18 CONTAINER_NAME="akraino-validation-ui"
24 # Container input parameters
25 MARIADB_AKRAINO_PASSWORD=""
28 JENKINS_USER_PASSWORD=""
36 KEY=$(echo $ARGUMENT | cut -f1 -d=)
37 VALUE=$(echo $ARGUMENT | cut -f2 -d=)
39 REGISTRY) REGISTRY=${VALUE} ;;
40 NAME) NAME=${VALUE} ;;
41 TAG_PRE) TAG_PRE=${VALUE} ;;
42 TAG_VER) TAG_VER=${VALUE} ;;
43 MARIADB_AKRAINO_PASSWORD) MARIADB_AKRAINO_PASSWORD=${VALUE} ;;
44 JENKINS_URL) JENKINS_URL=${VALUE} ;;
45 JENKINS_USERNAME) JENKINS_USERNAME=${VALUE} ;;
46 JENKINS_USER_PASSWORD) JENKINS_USER_PASSWORD=${VALUE} ;;
47 JENKINS_JOB_NAME) JENKINS_JOB_NAME=${VALUE} ;;
48 DB_IP_PORT) DB_IP_PORT=${VALUE} ;;
49 CONTAINER_NAME) CONTAINER_NAME=${VALUE} ;;
50 NEXUS_PROXY) NEXUS_PROXY=${VALUE} ;;
51 JENKINS_PROXY) JENKINS_PROXY=${VALUE} ;;
56 if [ -z "$DB_IP_PORT" ]
58 echo "ERROR: You must specify the database IP and port"
62 if [ -z "$MARIADB_AKRAINO_PASSWORD" ]
64 echo "ERROR: You must specify the mariadb akraino user password"
68 if [ -z "$JENKINS_URL" ]
70 echo "ERROR: You must specify the Jenkins Url"
74 if [ -z "$JENKINS_USERNAME" ]
76 echo "ERROR: You must specify the Jenkins username"
80 if [ -z "$JENKINS_USER_PASSWORD" ]
82 echo "ERROR: You must specify the Jenkins user password"
86 if [ -z "$JENKINS_JOB_NAME" ]
88 echo "ERROR: You must specify the Jenkins job name"
92 IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$TAG_VER"
93 docker run --detach --name $CONTAINER_NAME --network="host" -e DB_IP_PORT="$DB_IP_PORT" -e MARIADB_AKRAINO_PASSWORD="$MARIADB_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" $IMAGE