Skip to content

Instantly share code, notes, and snippets.

@geetikabatra
Created January 24, 2019 13:44
Show Gist options
  • Save geetikabatra/8c9e8e3d9ccc25d1a909ca7f576e1f6c to your computer and use it in GitHub Desktop.
Save geetikabatra/8c9e8e3d9ccc25d1a909ca7f576e1f6c to your computer and use it in GitHub Desktop.
deploy.sh
#!/bin/bash -e
here=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source helpers.sh
#Check for configuration file
if ! [ -f "${here}/env.sh" ]
then
echo '`env.sh` configuration file is missing.
echo
echo 'Modify the `env.sh` configuration file as necessary. See README.md file for more information.'
exit 1
fi
#Check if required commands are available
tool_is_installed oc
#Load configuration from env variables
source env.sh
#Check if required env variables are set
is_set_or_fail OC_USERNAME "${OC_USERNAME}"
is_set_or_fail OC_PASSWD "${OC_PASSWD}"
is_set_or_fail OC_TOKEN "${OC_TOKEN}"
templates_dir="${here}/templates"
oc_process_apply "${templates_dir}/pgbouncer.yaml"
sleep 20
oc_process_apply "${templates_dir}/data-model.yaml"
sleep 20
oc_process_apply "${templates_dir}/jobs.yaml"
sleep 20
oc_process_apply "${templates_dir}/server.yaml"
sleep 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment