X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=docker%2Fui%2Fdeploy.sh;h=c1be67453f8a6c358e7d43ef8ea9264231b4a225;hb=2eba847ebb6acb2686be08eb1cdafc1b12071e7d;hp=fef0bedd1386824c3bec01a7fd1de4d56cf3e442;hpb=c5ad3fa5dcff60eb9108ed303806ff28b31a9c09;p=validation.git diff --git a/docker/ui/deploy.sh b/docker/ui/deploy.sh index fef0bed..c1be674 100755 --- a/docker/ui/deploy.sh +++ b/docker/ui/deploy.sh @@ -14,26 +14,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -CONTAINER_NAME="validation-ui" +# Container name +CONTAINER_NAME="akraino-validation-ui" +# Image data REGISTRY=akraino NAME=validation -TAG_PRE=`echo "${PWD##*/}"` +TAG_PRE=ui TAG_VER=latest -HOST_ARCH=amd64 -postgres_db_user_pwd="" -jenkins_url="" -jenkins_user_name="" -jenkins_user_pwd="" -jenkins_job_name="" -nexus_results_url="" -proxy_ip="" -proxy_port="" - -# get the architecture of the host -if [ "`uname -m`" = "aarch64" ] - then - HOST_ARCH=arm64 -fi +# Container input parameters +MARIADB_AKRAINO_PASSWORD="" +JENKINS_URL="" +JENKINS_USERNAME="" +JENKINS_USER_PASSWORD="" +JENKINS_JOB_NAME="" +DB_IP_PORT="" +NEXUS_PROXY="" +JENKINS_PROXY="" for ARGUMENT in "$@" do @@ -42,55 +38,57 @@ do case "$KEY" in REGISTRY) REGISTRY=${VALUE} ;; NAME) NAME=${VALUE} ;; + TAG_PRE) TAG_PRE=${VALUE} ;; TAG_VER) TAG_VER=${VALUE} ;; - postgres_db_user_pwd) postgres_db_user_pwd=${VALUE} ;; - jenkins_url) jenkins_url=${VALUE} ;; - jenkins_user_name) jenkins_user_name=${VALUE} ;; - jenkins_user_pwd) jenkins_user_pwd=${VALUE} ;; - jenkins_job_name) jenkins_job_name=${VALUE} ;; - nexus_results_url) nexus_results_url=${VALUE} ;; - proxy_ip) proxy_ip=${VALUE} ;; - proxy_port) proxy_port=${VALUE} ;; + MARIADB_AKRAINO_PASSWORD) MARIADB_AKRAINO_PASSWORD=${VALUE} ;; + JENKINS_URL) JENKINS_URL=${VALUE} ;; + JENKINS_USERNAME) JENKINS_USERNAME=${VALUE} ;; + JENKINS_USER_PASSWORD) JENKINS_USER_PASSWORD=${VALUE} ;; + JENKINS_JOB_NAME) JENKINS_JOB_NAME=${VALUE} ;; + DB_IP_PORT) DB_IP_PORT=${VALUE} ;; + CONTAINER_NAME) CONTAINER_NAME=${VALUE} ;; + NEXUS_PROXY) NEXUS_PROXY=${VALUE} ;; + JENKINS_PROXY) JENKINS_PROXY=${VALUE} ;; *) esac done -if [ -z "$postgres_db_user_pwd" ] +if [ -z "$DB_IP_PORT" ] then - echo "ERROR: You must specify the postgresql root user password" + echo "ERROR: You must specify the database IP and port" exit 1 fi -if [ -z "$jenkins_url" ] +if [ -z "$MARIADB_AKRAINO_PASSWORD" ] then - echo "ERROR: You must specify the Jenkins Url" + echo "ERROR: You must specify the mariadb akraino user password" exit 1 fi -if [ -z "$jenkins_user_name" ] +if [ -z "$JENKINS_URL" ] then - echo "ERROR: You must specify the Jenkins username" + echo "ERROR: You must specify the Jenkins Url" exit 1 fi -if [ -z "$jenkins_user_pwd" ] +if [ -z "$JENKINS_USERNAME" ] then - echo "ERROR: You must specify the Jenkins user password" + echo "ERROR: You must specify the Jenkins username" exit 1 fi -if [ -z "$jenkins_job_name" ] +if [ -z "$JENKINS_USER_PASSWORD" ] then - echo "ERROR: You must specify the Jenkins job name" + echo "ERROR: You must specify the Jenkins user password" exit 1 fi -if [ -z "$nexus_results_url" ] +if [ -z "$JENKINS_JOB_NAME" ] then - echo "ERROR: You must specify the Nexus Url" + echo "ERROR: You must specify the Jenkins job name" exit 1 fi -IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$HOST_ARCH"-"$TAG_VER" -docker run --name $CONTAINER_NAME --network="host" -it --rm -e postgres_db_user_pwd="$postgres_db_user_pwd" -e jenkins_url="$jenkins_url" -e jenkins_user_name="$jenkins_user_name" -e jenkins_user_pwd="$jenkins_user_pwd" -e jenkins_job_name="$jenkins_job_name" -e nexus_results_url="$nexus_results_url" -e proxy_ip="$proxy_ip" -e proxy_port="$proxy_port" $IMAGE +IMAGE="$REGISTRY"/"$NAME":"$TAG_PRE"-"$TAG_VER" +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 sleep 10