<commit_before>#!/bin/bash

# All 5 arguments are required

PRIVATE_IP=$1
PAPERTRAIL_ADDRESS=$2
STACK=$3
SUFFIX=$4
ENV=$5
PGVERSION=$6

if [[ -z $PRIVATE_IP ]] || [[ -z $PAPERTRAIL_ADDRESS ]]; then
  echo "usage: new_postgres.sh <private ip address> <papertrailurl:port>"
  exit 1
fi

# install standard packages/utilities
cd ~/docker-stack/buildtools/utils/ || exit
sudo ./base-utils.sh

# install stack common to web and workers
cd ~/docker-stack/python/ || exit
sudo ./python.sh

cd ~/docker-stack/buildtools/utils || exit
sudo ./install-supervisor.sh custom

# enable logging
cd ~/docker-stack/logging/ || exit
./i-enable-logging.sh "$PAPERTRAIL_ADDRESS"

cd ~/docker-stack/web/python-nginx/ || exit
sudo ./nginx.sh

cd ~/docker-stack/web/python-nginx-pgpool/ || exit
sudo ./pgpool.sh "$PGVERSION"

cd ~/docker-stack/web/python-nginx-pgpool-redis/ || exit
sudo ./redis-client-install.sh


# Install customer-specific stack - all get the web portion.

cd ~/docker-stack/${STACK}-stack/web/ || exit
sudo ./web.sh

if [[ "$SUFFIX" = "worker" ]]; then
  cd ~/docker-stack/${STACK}-stack/worker/ || exit
  sudo ./worker.sh
fi

# Fix configuration files, using env vars distributed in the customer-specific (and private) utils.

if [[ (-n "${ENV}") && (-e ~/utils/environments) ]]; then
  ~/utils/environments/deployenv.sh $SUFFIX $ENV
fi

# Restart supervisor, so that all services are now running.
<commit_msg>establish working directory and change args for deployenv.sh<commit_after>#!/bin/bash

# All 5 arguments are required

PRIVATE_IP=$1
PAPERTRAIL_ADDRESS=$2
STACK=$3
SUFFIX=$4
ENV=$5
PGVERSION=$6

if [[ -z $PRIVATE_IP ]] || [[ -z $PAPERTRAIL_ADDRESS ]]; then
  echo "usage: new_postgres.sh <private ip address> <papertrailurl:port>"
  exit 1
fi

# install standard packages/utilities
cd ~/docker-stack/buildtools/utils/ || exit
sudo ./base-utils.sh

# install stack common to web and workers
cd ~/docker-stack/python/ || exit
sudo ./python.sh

cd ~/docker-stack/buildtools/utils || exit
sudo ./install-supervisor.sh custom

# enable logging
cd ~/docker-stack/logging/ || exit
./i-enable-logging.sh "$PAPERTRAIL_ADDRESS"

cd ~/docker-stack/web/python-nginx/ || exit
sudo ./nginx.sh

cd ~/docker-stack/web/python-nginx-pgpool/ || exit
sudo ./pgpool.sh "$PGVERSION"

cd ~/docker-stack/web/python-nginx-pgpool-redis/ || exit
sudo ./redis-client-install.sh


# Install customer-specific stack - all get the web portion.

cd ~/docker-stack/${STACK}-stack/web/ || exit
sudo ./web.sh

if [[ "$SUFFIX" = "worker" ]]; then
  cd ~/docker-stack/${STACK}-stack/worker/ || exit
  sudo ./worker.sh
fi

# Fix configuration files, using env vars distributed in the customer-specific (and private) utils.

if [[ (-n "${ENV}") && (-e ~/utils/environments) ]]; then
  pushd ~/utils/
  ./environments/deployenv.sh linux $ENV
  popd
fi

# Restart supervisor, so that all services are now running.

{'fraction_non_alphanumeric': 0.15469996531390912, 'fraction_numerical': 0.005549774540409296, 'mean_word_length': 3.822742474916388, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3685730', 'n_tokens_mistral': 1053, 'n_tokens_neox': 1009, 'n_words': 274}