3 # Copyright 2019 © Samsung Electronics Co., Ltd.
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.
17 echo "[INFO] This is sdc_workflow_d.sh"
19 source "${WORKSPACE}/scripts/sdc/setup_sdc_for_sanity.sh"
20 export ROBOT_VARIABLES
25 export ENV_NAME='CSIT'
28 _value=$(eval echo "\$${1}" | tr '[:upper:]' '[:lower:]')
39 # returns 0: if SDC_LOCAL_IMAGES is set to true value
40 # returns 1: otherwise
41 function using_local_workflow_images {
42 iss_true WORKFLOW_LOCAL_IMAGES
45 # cloning workflow directory
46 mkdir -p "${WORKSPACE}/data/clone/"
47 cd "${WORKSPACE}/data/clone"
48 if using_local_workflow_images && [ -n "$WORKFLOW_LOCAL_GITREPO" ] ; then
49 WORKFLOW_LOCAL_GITREPO=$(realpath "$WORKFLOW_LOCAL_GITREPO")
50 if [ -d "$WORKFLOW_LOCAL_GITREPO" ] ; then
52 cp -a "$WORKFLOW_LOCAL_GITREPO" ./workflow
54 echo "[ERROR]: Local git repo for workflow does not exist: ${WORKFLOW_LOCAL_GITREPO}"
58 git clone --depth 1 "https://github.com/onap/sdc-sdc-workflow-designer.git" -b ${GERRIT_BRANCH}
60 # set enviroment variables
61 source ${WORKSPACE}/data/clone/workflow/version.properties
62 export WORKFLOW_RELEASE=$major.$minor-STAGING-latest
64 SDC_CS=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sdc-cs)
65 SDC_BE=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sdc-BE)
66 echo "[INFO] Initialization of workflow init"
70 -e "CS_HOST=${SDC_CS}" \
72 -e "CS_AUTHENTICATE=true"\
73 -e "CS_USER=asdc_user" \
74 -e "CS_PASSWORD=Aa1234%^!" nexus3.onap.org:10001/onap/sdc-workflow-init:latest
76 echo "[INFO] Initialization of workflow Backend init"
77 docker run -d --name "workflow-backend" -e "SDC_PROTOCOL=http" \
78 -e "SDC_ENDPOINT=${SDC_BE}:8080" \
79 -e "SDC_USER=workflow" \
80 -e "SDC_PASSWORD=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" \
81 -e "CS_HOSTS=${SDC_CS}" \
83 -e "CS_AUTHENTICATE=true"\
84 -e "CS_USER=asdc_user" \
85 -e "CS_PASSWORD=Aa1234%^!" \
86 -e "CS_SSL_ENABLED=false"\
87 -e "SERVER_SSL_ENABLED=false" \
88 --env JAVA_OPTIONS="${BE_JAVA_OPTIONS}" --publish 8384:8080 --publish 10443:8443 --publish 8000:8000 nexus3.onap.org:10001/onap/sdc-workflow-backend:latest
90 WORKFLOW_BE=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' workflow-backend)
91 echo "[INFO] starting workflow designer fronend"
92 docker run -d --name "workflow-frontend" \
93 -e BACKEND="http://${WORKFLOW_BE}:8080"\
94 --publish 8484:8080 --publish 11443:8443 nexus3.onap.org:10001/onap/sdc-workflow-frontend:latest
96 cp "${WORKSPACE}/data/clone/sdc/sdc-os-chef/environments/plugins-configuration.yaml" \
97 "${WORKSPACE}/data/environments/plugins-configuration.yaml"
99 WF_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' workflow-frontend)
100 WFADDR="http:\/\/${WF_IP}:8080\/workflows"
103 -e "s/<%= @workflow_discovery_url %>/${WFADDR}/g" \
104 -e "s/<%= @workflow_source_url %>/${WFADDR}/g" \
105 "${WORKSPACE}/data/environments/plugins-configuration.yaml"
107 cp "${WORKSPACE}/data/clone/sdc/sdc-os-chef/scripts/docker_run.sh" "${WORKSPACE}/scripts/sdc-workflow-d/"
109 echo "[INFO] restarting sdc-FE with updated plugin configuration file with Worflow host ip"
111 "${WORKSPACE}/scripts/sdc-workflow-d/docker_run.sh" \
115 # This file is sourced in another script which is out of our control...