forked from containers/automation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.install.sh
executable file
·30 lines (22 loc) · 1012 Bytes
/
.install.sh
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
#!/bin/bash
# Installs cirrus-ci_env system-wide. NOT intended to be used directly
# by humans, should only be used indirectly by running
# ../bin/install_automation.sh <ver> cirrus-ci_env
set -eo pipefail
source "$AUTOMATION_LIB_PATH/anchors.sh"
source "$AUTOMATION_LIB_PATH/console_output.sh"
INSTALL_PREFIX=$(realpath $AUTOMATION_LIB_PATH/../)
# Assume the directory this script is in, represents what is being installed
INSTALL_NAME=$(basename $(dirname ${BASH_SOURCE[0]}))
AUTOMATION_VERSION=$(automation_version)
[[ -n "$AUTOMATION_VERSION" ]] || \
die "Could not determine version of common automation libs, was 'install_automation.sh' successful?"
echo "Installing $INSTALL_NAME version $(automation_version) into $INSTALL_PREFIX"
unset INST_PERM_ARG
if [[ $UID -eq 0 ]]; then
INST_PERM_ARG="-o root -g root"
fi
cd $(dirname $(realpath "${BASH_SOURCE[0]}"))
install -v cirrus-ci_env.py -D "$INSTALL_PREFIX/bin/"
# Needed for installer testing
echo "Successfully installed $INSTALL_NAME"