<commit_before>#!/bin/bash -ex

# Variables needed by this script:
#  - EFS_FILE_SYSTEM

export ASTROBIN_BUILD=${RELEASE_TAG}
export ASTROBIN_TEMPORARY_FILES=/astrobin-temporary-files
export USER=ubuntu
export GROUP=ubuntu
export NGINX_MODE=dev


# Install efs-utils:

git clone https://github.com/aws/efs-utils && (cd efs-utils && ./build-deb.sh && apt-get -y install ./build/amazon-efs-utils*deb)

# Mount EFS:

mkdir ${ASTROBIN_TEMPORARY_FILES}
mount -t efs -o tls ${EFS_FILE_SYSTEM}:/ ${ASTROBIN_TEMPORARY_FILES}
mkdir -p ${ASTROBIN_TEMPORARY_FILES}/files
chown ${USER}:${GROUP} ${ASTROBIN_TEMPORARY_FILES}/files

# Create docker stack:

docker swarm init
docker stack deploy -c docker/docker-compose-app.yml app<commit_msg>(infra) Fix nginx mode variable in ec2 user data script<commit_after>#!/bin/bash -ex

# Variables needed by this script:
#  - EFS_FILE_SYSTEM

export ASTROBIN_BUILD=${RELEASE_TAG}
export ASTROBIN_TEMPORARY_FILES=/astrobin-temporary-files
export USER=ubuntu
export GROUP=ubuntu
export NGINX_MODE=prod


# Install efs-utils:

git clone https://github.com/aws/efs-utils && (cd efs-utils && ./build-deb.sh && apt-get -y install ./build/amazon-efs-utils*deb)

# Mount EFS:

mkdir ${ASTROBIN_TEMPORARY_FILES}
mount -t efs -o tls ${EFS_FILE_SYSTEM}:/ ${ASTROBIN_TEMPORARY_FILES}
mkdir -p ${ASTROBIN_TEMPORARY_FILES}/files
chown ${USER}:${GROUP} ${ASTROBIN_TEMPORARY_FILES}/files

# Create docker stack:

docker swarm init
docker stack deploy -c docker/docker-compose-app.yml app
{'fraction_non_alphanumeric': 0.12408272181454302, 'fraction_numerical': 0.00066711140760507, 'mean_word_length': 5.302521008403361, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2118069', 'n_tokens_mistral': 597, 'n_tokens_neox': 542, 'n_words': 126}