-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup
executable file
·44 lines (35 loc) · 1.33 KB
/
setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
# Setup script for Artsy's use.
# It assumes that the general Artsy pre-requisites are already installed.
# Please see: https://github.com/artsy/potential/blob/master/scripts/setup
trap 'ret=$?; test $ret -ne 0 && printf "Setup script failed.\n\n" >&2; exit $ret' EXIT
set -e
python_version=$(cat .python-version)
if (command -v pyenv >/dev/null)
then
echo "Found Pyenv."
if (pyenv versions | grep -Fq "$python_version")
then
echo "Found Python $python_version."
else
echo "Using Pyenv to install Python $python_version..."
pyenv install -s "$python_version"
fi
pyenv rehash
echo "Installing Poetry..."
pip install poetry
echo "Running poetry install..."
poetry install
else
echo "Pyenv not found, will not install Python packages, for fear of polluting system-wide Python installation."
fi
echo "Downloading .env.shared (project's local dev configuration common across developers)..."
aws s3 cp s3://artsy-citadel/opstools/.env.shared ./
echo "Downloading config-opstools Kubeconfig (useful for locally testing Kubernetes-related scripts ..."
aws s3 cp s3://artsy-citadel/k8s/config-opstools ~/.kube
if [ ! -e ".env" ]; then
echo "Initializing .env from .env.example (for any custom local dev configuration)..."
cp .env.example .env
fi
echo "Adding pre-commit hook..."
cp bin/pre-commit .git/hooks/pre-commit