<commit_before>#!/bin/sh
#
# Mon Nov  6 15:03:49 2017 GW Shell script run by 'oc exec' on OpenShift
#   initiated by Jenkins job, which connects to the application server
#   pod (gwells-nn-xxxxx which is STATUS = 'Running'):
#      oc exec gwells-nnn-xxxx $VIRTUAL_ENV/src/openshift/scripts/gwells-deploy.sh
#
#   This deploy is triggered on all three envionments (moe-gwells-dev,
#   moe-gwells-test, moe-gwells-prod)
#
#   Example: oc exec gwells-97-69b7z /opt/app-root/src/openshift/scripts/gwells-deploy.sh
#
#   If run on local Developer workstation, ensure that you have Environment variables set
#   for $DATABASE_SERVICE_NAME, $DATABASE_PASSWORD, $DATABASE_NAME, $DATABASE_USER
#
#   Optionally, set $DB_REPLICATE (None|Subset|Full).
#
#   Example: ./gwells-deploy.sh


# Sensitive, keep before 'set -x'
#
export PGPASSWORD=$<PASSWORD>


# Halt conditions, verbosity and field separator
#
set -xeuo pipefail
IFS=$'\n\t'


# Python migrate table changes
#
echo "Post-Deploy: Python migration"
cd $APP_ROOT/src/
python manage.py migrate


# Create additional DB objects (e.g. spatial indices, stored procedures)
#
echo "Post-Deploy: SQL imports"
cd $APP_ROOT/src/database/scripts/wellsearch/
psql -X --set ON_ERROR_STOP=on -h $DATABASE_SERVICE_NAME -d $DATABASE_NAME -U $DATABASE_USER -f \
	post-deploy.sql
psql -X --set ON_ERROR_STOP=on -h $DATABASE_SERVICE_NAME -d $DATABASE_NAME -U $DATABASE_USER -f \
	wells_replication_stored_functions.sql


# Python related portion of post-deploy
#
echo "Post-Deploy: Python tasks"
cd $APP_ROOT/src/
python manage.py post-deploy


# Success!
#
echo "Post-Deploy: completed successfully"<commit_msg>cd $APP_ROOT/src/ -> cd $APP_ROOT/src/backend/<commit_after>#!/bin/sh
#
# Mon Nov  6 15:03:49 2017 GW Shell script run by 'oc exec' on OpenShift
#   initiated by Jenkins job, which connects to the application server
#   pod (gwells-nn-xxxxx which is STATUS = 'Running'):
#      oc exec gwells-nnn-xxxx $VIRTUAL_ENV/src/openshift/scripts/gwells-deploy.sh
#
#   This deploy is triggered on all three envionments (moe-gwells-dev,
#   moe-gwells-test, moe-gwells-prod)
#
#   Example: oc exec gwells-97-69b7z /opt/app-root/src/openshift/scripts/gwells-deploy.sh
#
#   If run on local Developer workstation, ensure that you have Environment variables set
#   for $DATABASE_SERVICE_NAME, $DATABASE_PASSWORD, $DATABASE_NAME, $DATABASE_USER
#
#   Optionally, set $DB_REPLICATE (None|Subset|Full).
#
#   Example: ./gwells-deploy.sh


# Sensitive, keep before 'set -x'
#
export PGPASSWORD=$DATABASE_PASSWORD


# Halt conditions, verbosity and field separator
#
set -xeuo pipefail
IFS=$'\n\t'


# Python migrate table changes
#
echo "Post-Deploy: Python migration"
cd $APP_ROOT/src/backend/
python manage.py migrate


# Create additional DB objects (e.g. spatial indices, stored procedures)
#
echo "Post-Deploy: SQL imports"
cd $APP_ROOT/src/database/scripts/wellsearch/
psql -X --set ON_ERROR_STOP=on -h $DATABASE_SERVICE_NAME -d $DATABASE_NAME -U $DATABASE_USER -f \
	post-deploy.sql
psql -X --set ON_ERROR_STOP=on -h $DATABASE_SERVICE_NAME -d $DATABASE_NAME -U $DATABASE_USER -f \
	wells_replication_stored_functions.sql


# Python related portion of post-deploy
#
echo "Post-Deploy: Python tasks"
cd $APP_ROOT/src/backend/
python manage.py post-deploy


# Success!
#
echo "Post-Deploy: completed successfully"
{'fraction_non_alphanumeric': 0.1108786610878661, 'fraction_numerical': 0.009563658099222952, 'mean_word_length': 4.321144674085851, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3684284', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1212, 'n_words': 328}