Skip to content

Commit 6062bb5

Browse files
committed
-> Display app version in the logs (because sometimes the datetime is wrong...)
1 parent 877b076 commit 6062bb5

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

shell/install-deps.sh

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
if [ -n "$CI" ]; then
2-
echo "Check our Python and Ubuntu versions since they keep getting updated without warning..."
2+
echo "[STATUS] Check our Python and OS versions since they keep getting updated without warning..."
33

44
ls -l /usr/bin/python3*
55
cat /etc/os-release
@@ -14,7 +14,7 @@ if [ -n "$CI" ]; then
1414
elif [[ ${CIRCLE_BRANCH} == "expr" ]]; then
1515
COMMON_BRANCH=expr
1616
fi
17-
echo "Cloning IDC-Common branch ${COMMON_BRANCH}..."
17+
echo "[STATUS] Cloning IDC-Common branch ${COMMON_BRANCH}..."
1818
git clone -b ${COMMON_BRANCH} https://github.com/ImagingDataCommons/IDC-Common.git
1919
else
2020
if ( "/home/vagrant/www/shell/get_env.sh" ) ; then
@@ -35,7 +35,7 @@ find . -type f -name '*.pyc' -delete
3535
apt-get update -qq
3636
3737
# Install and update apt-get info
38-
echo "Preparing System..."
38+
echo "[STATUS] Preparing System..."
3939
apt-get -y --force-yes install software-properties-common ca-certificates gnupg
4040
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv B7B3B788A8D3785C
4141
wget "https://repo.mysql.com/mysql-apt-config_0.8.30-1_all.deb" -P /tmp
@@ -46,48 +46,48 @@ apt-get update -qq
4646
apt-get install mysql-client
4747
4848
# Install apt-get dependencies
49-
echo "Installing Dependencies..."
49+
echo "[STATUS] Installing Dependencies..."
5050
apt-get install -y --force-yes unzip libffi-dev libssl-dev git g++ curl dos2unix pkg-config
5151
apt-get install -y --force-yes python3-distutils python3-mysqldb libmysqlclient-dev libpython3-dev build-essential
5252
apt-get install -y --force-yes python3-pip
5353
54-
echo "Dependencies Installed"
54+
echo "[STATUS] Dependencies Installed"
5555
5656
# If this is local development, clean out lib for a re-structuring
5757
if [ -z "${CI}" ]; then
5858
# Clean out lib to prevent confusion over multiple builds in local development
5959
# and prep for local install
60-
echo "Emptying out ${HOMEROOT}/lib/ ..."
60+
echo "[STATUS] Emptying out ${HOMEROOT}/lib/ ..."
6161
rm -rf "${HOMEROOT}/lib/"
62-
echo "Confirming clearance of lib:"
62+
echo "[STATUS] Confirming clearance of lib:"
6363
ls ${HOMEROOT}/lib/
6464
fi
6565
6666
# Install PIP + Dependencies
67-
echo "Installing pip3..."
67+
echo "[STATUS] Installing pip3..."
6868
curl --silent https://bootstrap.pypa.io/get-pip.py | python3
6969
7070
# Install our primary python libraries
7171
# If we're not on CircleCI, or we are but the lib directory isn't there (cache miss), install lib
7272
if [ -z "${CI}" ] || [ ! -d "lib" ]; then
73-
echo "Installing Python Libraries..."
73+
echo "[STATUS] Installing Python Libraries..."
7474
pip install -r ${HOMEROOT}/requirements.txt -t ${HOMEROOT}/lib --upgrade --only-binary all
7575
else
76-
echo "Using restored cache for Python Libraries"
76+
echo "[STATUS] Using restored cache for Python Libraries"
7777
fi
7878
7979
if [ -z "${CI}" ]; then
80-
echo "Installing responses library for unit tests, but not for deployment..."
80+
echo "[STATUS] Installing responses library for unit tests, but not for deployment..."
8181
pip install -q responses -t ${HOMEROOT}/lib --only-binary all
8282
fi
8383
8484
if [ "$DEBUG" = "True" ] && [ "$DEBUG_TOOLBAR" = "True" ]; then
85-
echo "Installing Django Debug Toolbar for local dev..."
85+
echo "[STATUS] Installing Django Debug Toolbar for local dev..."
8686
pip install -q django-debug-toolbar==3.2.4 -t ${HOMEROOT}/lib --only-binary all
8787
fi
8888
8989
if [ "$IS_DEV" = "True" ]; then
90-
echo "Installing GitPython for local dev version display..."
90+
echo "[STATUS] Installing GitPython for local dev version display..."
9191
pip install -q gitpython -t ${HOMEROOT}/lib --only-binary all
9292
fi
9393
@@ -96,22 +96,22 @@ echo "Libraries Installed"
9696
# Install Google Cloud SDK
9797
# If we're not on CircleCI or we are but google-cloud-sdk isn't there, install it
9898
if [ -z "${CI}" ] || [ ! -d "/usr/lib/google-cloud-sdk" ]; then
99-
echo "Installing Google Cloud SDK..."
99+
echo "[STATUS] Installing Google Cloud SDK..."
100100
export CLOUDSDK_CORE_DISABLE_PROMPTS=1
101101
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
102102
apt-get -y install apt-transport-https ca-certificates
103103
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
104104
apt-get update -qq
105105
apt-get -y install google-cloud-sdk
106106
apt-get -y install google-cloud-sdk-app-engine-python
107-
echo "Google Cloud SDK Installed"
107+
echo "[STATUS] Google Cloud SDK Installed"
108108
fi
109109
110110
# Run dos2unix on the files in shell/ because of line terminator shenanigans with Windows
111-
echo "Running dos2unix on shell/*.sh..."
111+
echo "[STATUS] Running dos2unix on shell/*.sh..."
112112
dos2unix ${HOMEROOT}/shell/*.sh
113113
114-
echo "Loading Git Hooks"
114+
echo "[STATUS] Loading Git Hooks"
115115
if [ -z "${CI}" ] && [ -d "${HOMEROOT}/git-hooks/" ]; then
116116
cp -r ${HOMEROOT}/git-hooks/* ${HOMEROOT}/.git/hooks/
117117
fi
@@ -123,5 +123,7 @@ if [ -n "${CI}" ]; then
123123
else
124124
TIER=${DEPLOYMENT_TIER,,}
125125
fi
126-
echo "APP_VERSION=${TIER}.$(date '+%Y%m%d%H%M').${APP_SHA}" > ${HOMEROOT}/version.env
126+
VERSION="${TIER}.$(date '+%Y%m%d%H%M').${APP_SHA}"
127+
echo "[STATUS] Application version set to ${VERSION}"
128+
echo "APP_VERSION=${VERSION}" > ${HOMEROOT}/version.env
127129
fi

0 commit comments

Comments
 (0)