From 0a2b21042093a6418f06df8e78f2c0c806e2e6f5 Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Sun, 9 Feb 2020 13:54:10 -0800 Subject: [PATCH] Move application code management to build.sh --- .sandstorm/build.sh | 12 ++++++++++++ .sandstorm/setup.sh | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.sandstorm/build.sh b/.sandstorm/build.sh index 30f128c..93ccc27 100755 --- a/.sandstorm/build.sh +++ b/.sandstorm/build.sh @@ -1,6 +1,18 @@ #!/bin/bash set -euo pipefail +# Get application code. +cd /opt/app +rm -rf babybuddy +git clone https://github.com/babybuddy/babybuddy.git + +# Set up required application environment variables. +SECRET_KEY=$(python -c 'import random; result = "".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]); print(result)') +cat < /opt/app/babybuddy/.env +DJANGO_SETTINGS_MODULE=babybuddy.settings.sandstorm +SECRET_KEY=$SECRET_KEY +EOF + # Checkout desired version and apply Sandstorm patch. VERSION=$(grep -oE 'appMarketingVersion = \(defaultText = "(.+)"' /opt/app/.sandstorm/sandstorm-pkgdef.capnp | cut -d '"' -f2) cd /opt/app/babybuddy diff --git a/.sandstorm/setup.sh b/.sandstorm/setup.sh index 553e4fa..8b396ae 100755 --- a/.sandstorm/setup.sh +++ b/.sandstorm/setup.sh @@ -10,15 +10,3 @@ apt-get install -y nginx uwsgi uwsgi-plugin-python3 python-virtualenv pipenv sql # Disable nginx (controlled by `launcher.sh`). service nginx stop systemctl disable nginx - -# Get application code. -cd /opt/app -rm -rf babybuddy -git clone https://github.com/babybuddy/babybuddy.git - -# Set up required application environment variables. -SECRET_KEY=$(python -c 'import random; result = "".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]); print(result)') -cat < /opt/app/babybuddy/.env -DJANGO_SETTINGS_MODULE=babybuddy.settings.sandstorm -SECRET_KEY=$SECRET_KEY -EOF