Skip to content

Commit

Permalink
move file
Browse files Browse the repository at this point in the history
  • Loading branch information
punkrokk committed Sep 17, 2019
1 parent 653089e commit e001c99
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 26 deletions.
File renamed without changes.
File renamed without changes.
23 changes: 3 additions & 20 deletions ci_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,22 @@ if [ "$(uname)" == "Darwin" ]; then
printf "OSX detected. This script does not install docker and other tools. Needed to run properly.\n\n"
fi

quay_user=${QUAY_USER}
quay_key=${QUAY_KEY}


printf "moving .env into place from template"
cp env.template .env

key=$(openssl rand -base64 32)
printf "Here's a fresh MB_ENCRYPTION_SECRET_KEY: ${key}\n"

# replace / with @ for sed (https://stackoverflow.com/questions/32252458/how-to-pass-base64-ecoded-content-to-sed)
if [ "$(uname)" == "Darwin" ]; then
# gnu-sed on OSX
gsed -i "s@MB_ENCRYPTION_SECRET_KEY.*@MB_ENCRYPTION_SECRET_KEY=${key}@g" \.env
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# sed in linux
sed -i "s@MB_ENCRYPTION_SECRET_KEY.*@MB_ENCRYPTION_SECRET_KEY=${key}@g" \.env
fi

printf "Dev environment setup complete.\n"

printf "I created a new .env settings file and set your randomly generated encryption key.\n"
echo "Please write down your key:"
echo "${key}"
printf "I created a new .env settings file.\n"

# sleep 3s

# read -p 'Enter your quay.io username:' quay_user
# read -sp 'Please enter your Syncurity Image Key:' quay_key
docker login -u ${quay_user} -p ${quay_key} quay.io
# sleep 3s


printf "Starting Syncurity Metabase Reporting....\n\n"
printf "Starting Syncurity Services....\n\n"
docker-compose up -d

printf "\nBrowse to http://localhost:3000 to setup metabase\n\n"
Expand Down
12 changes: 6 additions & 6 deletions prod_environment.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/bin/bash -eux

if [ "$(uname)" == "Darwin" ]; then
printf "OSX detected. This script does not install docker and other tools. Needed to run properly.\n\n"
Expand All @@ -18,7 +18,7 @@ fi
printf "Prod environment setup complete\n"


printf "Starting Syncurity Metabase Reporting....\n\n"
printf "Starting Syncurity Services....\n\n"
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d


Expand Down Expand Up @@ -51,20 +51,20 @@ docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
# printf "\nBrowse to http://localhost:3000 to setup metabase\n\n"
#fi

printf "Use start-metabase.sh and stop-metabase.sh to turn server on and off \n"
printf "Use bin/start_syn_services.sh and bin/stop_syn_services.sh to turn server on and off \n"

echo "Removing env vars from memory"
unset -v MB_DB_DBNAME MB_DB_PASS MB_ENCRYPTION_SECRET_KEY MB_JETTY_SSL_Keystore_Password POSTGRESQL_ADMIN_PASSWORD
unset -v POSTGRESQL_ADMIN_PASSWORD

#Show container environment
sleep 5 && docker ps

echo "Waiting for Metabase to come up..."
echo "Waiting for Syncurity Service to come up..."
docker logs syncurity_postgresql


# while not docker logs metabase_web | grep
until [ "docker logs syncurity_postgresql | grep COMPLETE" ]; do
until [[ $(docker logs syncurity_postgresql | grep COMPLETE) ]]; do
print "$(docker logs syncurity_postgresql | grep COMPLETE)"
done

Expand Down
File renamed without changes.

0 comments on commit e001c99

Please sign in to comment.