diff options
author | Vitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com> | 2018-07-23 06:37:14 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-07-23 06:37:14 +0000 |
commit | 95ed34cc5b88a7b3a58da31724d5503b3b220cea (patch) | |
tree | e9fa733df69d6d6c994beb4f77cdb2f1fa32d153 /workflow | |
parent | 08c2c54d6ea09a95ad6241419946199dc6b4c5d0 (diff) | |
parent | 21dc9f49b2376a6b93976cd9a192d6e48e2733d9 (diff) |
Merge "Workflow Docker containers"
Diffstat (limited to 'workflow')
-rw-r--r-- | workflow/README.md | 16 | ||||
-rw-r--r-- | workflow/workflow-designer-init/src/main/docker/start.sh | 21 |
2 files changed, 32 insertions, 5 deletions
diff --git a/workflow/README.md b/workflow/README.md index 40b4bbb2..2b6bcbce 100644 --- a/workflow/README.md +++ b/workflow/README.md @@ -2,13 +2,25 @@ ## 1. Initialize Workflow Database -`docker run -d -e CS_HOST={HOST} -e CS_PORT={PORT} -e CS_USER={USER} -e CS_PASSWORD={PASSWORD} {INIT_IMAGE}` +`docker run -d -e CS_AUTHENTICATE={CS_AUTHENTICATE} -e CS_HOST={HOST} -e CS_PORT={PORT} -e CS_USER={USER} +-e CS_PASSWORD={PASSWORD} {INIT_IMAGE}` This is done only once to initialize the DB schema. **Example** -`docker run -d -e CS_HOST=10.247.41.19 -e CS_USER=test -e CS_PASSWORD=secret -e CS_PORT=9160 onap/workflow-init:latest` +running docker with secured Cassandra DB + +`docker run -d -e CS_HOST=10.247.41.19 -e CS_AUTHENTICATE=true -e CS_USER=test -e CS_PASSWORD=secret -e CS_PORT=9160 +onap/workflow-init:latest` + +running docker with unsecured Cassandra DB + +`docker run -d -e CS_HOST=10.247.41.19 -e CS_AUTHENTICATE=false -e CS_PORT=9160 onap/workflow-init:latest` + +or + +`docker run -d -e CS_HOST=10.247.41.19 -e CS_PORT=9160 onap/workflow-init:latest` ## 2. Start Backend diff --git a/workflow/workflow-designer-init/src/main/docker/start.sh b/workflow/workflow-designer-init/src/main/docker/start.sh index ac89d6c0..919277fd 100644 --- a/workflow/workflow-designer-init/src/main/docker/start.sh +++ b/workflow/workflow-designer-init/src/main/docker/start.sh @@ -1,11 +1,21 @@ #!/bin/sh -if [[ -z "${CS_USER}" ]]; then +is_cs_unauthenticated=1 +FALSE=0 +if [[ -z "${CS_AUTHENTICATE}" || "${CS_AUTHENTICATE}" == "false" ]]; then + is_cs_unauthenticated=$FALSE +fi + +if [ $is_cs_unauthenticated -eq $FALSE ]; then + echo "Establishing unsecured connection to Cassandra" +fi + +if [[ $is_cs_unauthenticated -eq 1 && -z "${CS_USER}" ]]; then echo "CS_USER environment variable must be set" exit 1 fi -if [[ -z "${CS_PASSWORD}" ]]; then +if [[ $is_cs_unauthenticated -eq 1 && -z "${CS_PASSWORD}" ]]; then echo "CS_PASSWORD environment variable must be set" exit 1 fi @@ -15,4 +25,9 @@ if [[ -z "${CS_HOST}" ]]; then exit 1 fi -cqlsh -u ${CS_USER} -p ${CS_PASSWORD} -f /create_workflow_db.cql ${CS_HOST} ${CS_PORT} +if [ $is_cs_unauthenticated -eq 1 ]; then + cqlsh -u ${CS_USER} -p ${CS_PASSWORD} -f /create_workflow_db.cql ${CS_HOST} ${CS_PORT} +else + cqlsh -f /create_workflow_db.cql ${CS_HOST} ${CS_PORT} +fi + |