2020-06-18 07:49:13 +00:00
|
|
|
#!/usr/bin/env bash
|
2019-03-03 22:51:52 +00:00
|
|
|
|
2020-06-21 11:31:21 +00:00
|
|
|
if [[ $(uname) == "Darwin" ]]; then
|
|
|
|
echo "Authelia's development workflow currently isn't supported on macOS"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2022-02-08 05:09:45 +00:00
|
|
|
export PATH=$PATH:./cmd/authelia-scripts/:./.buildkite/steps/:$GOPATH/bin:./web/node_modules/.bin:/tmp \
|
|
|
|
DOCKER_BUILDKIT=1
|
2019-03-03 22:51:52 +00:00
|
|
|
|
2020-02-03 07:25:53 +00:00
|
|
|
if [[ -z "$OLD_PS1" ]]; then
|
2019-10-29 20:54:47 +00:00
|
|
|
OLD_PS1="$PS1"
|
|
|
|
export PS1="(authelia) $PS1"
|
|
|
|
fi
|
2019-03-03 22:51:52 +00:00
|
|
|
|
2020-02-03 07:25:53 +00:00
|
|
|
if [[ $(id -u) = 0 ]]; then
|
2019-12-27 11:07:53 +00:00
|
|
|
echo "Cannot run as root, defaulting to UID 1000"
|
|
|
|
export USER_ID=1000
|
|
|
|
else
|
|
|
|
export USER_ID=$(id -u)
|
|
|
|
fi
|
|
|
|
|
2020-02-03 07:25:53 +00:00
|
|
|
if [[ $(id -g) = 0 ]]; then
|
2019-12-27 11:07:53 +00:00
|
|
|
echo "Cannot run as root, defaulting to GID 1000"
|
|
|
|
export GROUP_ID=1000
|
|
|
|
else
|
|
|
|
export GROUP_ID=$(id -g)
|
|
|
|
fi
|
2019-11-30 16:49:52 +00:00
|
|
|
|
2020-06-21 11:31:21 +00:00
|
|
|
if [[ "$CI" != "true" ]]; then
|
2019-12-27 11:07:53 +00:00
|
|
|
export CI=false
|
|
|
|
fi
|
2019-03-03 22:51:52 +00:00
|
|
|
|
2019-10-29 20:54:47 +00:00
|
|
|
echo "[BOOTSTRAP] Checking if Go is installed..."
|
2020-02-03 07:25:53 +00:00
|
|
|
if [[ ! -x "$(command -v go)" ]];
|
2019-03-03 22:51:52 +00:00
|
|
|
then
|
2019-10-29 20:54:47 +00:00
|
|
|
echo "[ERROR] You must install Go on your machine.";
|
2019-03-03 22:51:52 +00:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2019-12-27 11:07:53 +00:00
|
|
|
authelia-scripts bootstrap
|