Skip to content

Commit

Permalink
update scripts to reflect new filepaths
Browse files Browse the repository at this point in the history
  • Loading branch information
Niicck committed Apr 17, 2019
1 parent 98a33e9 commit d68865e
Show file tree
Hide file tree
Showing 16 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion deployment/dev_deploy_options.json
@@ -1,5 +1,6 @@
{
"forms_to_deploy": [
"officer-complaint-form"
"officer-complaint-form",
"officer-thank-form"
]
}
2 changes: 1 addition & 1 deletion deployment/scripts/build_form.sh
Expand Up @@ -23,7 +23,7 @@ while getopts "f:e:" opt; do
esac
done

FORM_PATH="$CURRENT_DIR/../../src/$FORM"
FORM_PATH="$CURRENT_DIR/../../forms/$FORM"
ENV_VAR_PATH="$FORM_PATH/deployment/vars/$DEPLOY_ENV.sh"

if [ -z $FORM ]; then
Expand Down
6 changes: 3 additions & 3 deletions deployment/scripts/deploy_one_form.sh
Expand Up @@ -5,7 +5,7 @@
CURRENT_DIR=`dirname $BASH_SOURCE`
DEPLOY_ENV=$1
FORM=$2
FORM_PATH="$CURRENT_DIR/../../src/$FORM"
FORM_PATH="$CURRENT_DIR/../../forms/$FORM"
ENV_VAR_PATH="$FORM_PATH/deployment/vars/$DEPLOY_ENV.sh"

if [ ! -d $FORM_PATH ]; then
Expand All @@ -22,7 +22,7 @@ source $ENV_VAR_PATH

# Install dependencies for Form and its Chapters
yarn --cwd $FORM_PATH install --production=false
CHAPTERS_PATH="$CURRENT_DIR/../../src/shared/chapters/$CHAPTERS_DIR"
CHAPTERS_PATH="$CURRENT_DIR/../../shared/chapters/$CHAPTERS_DIR"
yarn --cwd $CHAPTERS_PATH install --production=false

# Build all locales for a Form using Webpack
Expand All @@ -32,7 +32,7 @@ $CURRENT_DIR/build_form.sh -f $FORM -e $DEPLOY_ENV
$CURRENT_DIR/upload_form.sh -f $FORM -e $DEPLOY_ENV

# Upload all translations for Form to AWS
for LANGUAGE in $(jq -r ".supported_languages[]" "$FORM_PATH/src/locale/settings.json");
for LANGUAGE in $(jq -r ".supported_languages[]" "$FORM_PATH/locale/settings.json");
do
$CURRENT_DIR/upload_form.sh -f $FORM -e $DEPLOY_ENV -l $LANGUAGE
done;
2 changes: 1 addition & 1 deletion deployment/scripts/run.sh
Expand Up @@ -5,7 +5,7 @@ CURRENT_DIR=`dirname $BASH_SOURCE`
# Catch any errors in dev_deploy_options.json
for FORM in $(jq -r ".forms_to_deploy[]" "$CURRENT_DIR/../dev_deploy_options.json");
do
FORM_PATH="$CURRENT_DIR/../../src/$FORM"
FORM_PATH="$CURRENT_DIR/../../forms/$FORM"
if [ ! -d $FORM_PATH ]; then
echo "ERROR in dev_deploy_options.json: form \"$FORM\" does not exist"
exit 1
Expand Down
6 changes: 3 additions & 3 deletions deployment/scripts/translate_form.sh
Expand Up @@ -23,7 +23,7 @@ while getopts "f:l:" opt; do
esac
done

FORM_PATH="$CURRENT_DIR/../../src/$FORM"
FORM_PATH="$CURRENT_DIR/../../forms/$FORM"
TRANSLATION_PATH="${FORM_PATH}/public_${LANGUAGE}";

if [ -z $FORM ]; then
Expand All @@ -43,7 +43,7 @@ fi
##### Begin #####

echo "First, let's translate the routes:";
python3 "$CURRENT_DIR/translate.py" "$FORM_PATH/src/locale/routes.json" "$TRANSLATION_PATH/js/app.bundle.js" "${LANGUAGE}" --routes
python3 "$CURRENT_DIR/translate.py" "$FORM_PATH/locale/routes.json" "$TRANSLATION_PATH/js/app.bundle.js" "${LANGUAGE}" --routes

echo "Then, let's translate the rest of the form:"
python3 "$CURRENT_DIR/translate.py" "$FORM_PATH/src/locale/translations.json" "${TRANSLATION_PATH}/js/app.bundle.js" "${LANGUAGE}"
python3 "$CURRENT_DIR/translate.py" "$FORM_PATH/locale/translations.json" "${TRANSLATION_PATH}/js/app.bundle.js" "${LANGUAGE}"
2 changes: 1 addition & 1 deletion deployment/scripts/upload_form.sh
Expand Up @@ -28,7 +28,7 @@ while getopts "f:e:l:" opt; do
esac
done

FORM_PATH="$CURRENT_DIR/../../src/$FORM"
FORM_PATH="$CURRENT_DIR/../../forms/$FORM"
if [[ ! -z $LANGUAGE ]] && [[ $LANGUAGE != "en" ]]; then
TRANSLATED="true"
fi
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit d68865e

Please sign in to comment.