forked from CircleCI-Archived/image-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcircleci-install
More file actions
executable file
·43 lines (32 loc) · 800 Bytes
/
circleci-install
File metadata and controls
executable file
·43 lines (32 loc) · 800 Bytes
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
#!/bin/bash
[ -n "$CIRCLECI_USER" ] || export CIRCLECI_USER=ubuntu
[ -n "$RUN_APT_UPDATE" ] || export RUN_APT_UPDATE=false
export CIRCLECI_HOME=/home/${CIRCLECI_USER}
export CIRCLECI_PKG_DIR=/opt/circleci
if ! [ -d $CIRCLECI_PKG_DIR ]; then
mkdir -p $CIRCLECI_PKG_DIR
chown -R $CIRCLECI_USER:$CIRCLECI_USER $CIRCLECI_PKG_DIR
fi
function as_user() {
sudo -H -u ${CIRCLECI_USER} $@
}
export -f as_user
function maybe_run_apt_update() {
if [ $RUN_APT_UPDATE = "true" ]; then
apt-get update
fi
}
export -f maybe_run_apt_update
[[ $SCRIPTS_PATH ]] || export SCRIPTS_PATH=/opt/circleci-provision-scripts
set -a
set -e
if [ "$VERBOSE" = "true" ]; then
echo "enabling debug mode...."
set -x
fi
export SHELLOPTS
for n in $SCRIPTS_PATH/*.sh
do
source $n
done
install_$@