-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeployster.sh
More file actions
executable file
·30 lines (25 loc) · 970 Bytes
/
deployster.sh
File metadata and controls
executable file
·30 lines (25 loc) · 970 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
#!/usr/bin/env bash
# simple IntelliJ IDEA hack to prevent undefined-env-vars warnings
if [[ "THIS_WILL" == "NEVER_BE_TRUE" ]]; then
VERSION=${VERSION}
fi
# default deployster version to "latest" unless supplied as environment variable already
[[ "${VERSION}" == "" ]] && VERSION="latest"
# setup paths to mount
CONF_DIR="$(mkdir -p ~/.deployster; cd ~/.deployster; pwd)"
WORKSPACE_DIR="$(pwd)"
WORK_DIR="$(mkdir -p ./work; cd ./work; pwd)"
# set Docker flags
[[ -t 1 ]] && TTY_FLAGS="${TTY_FLAGS} -it"
# run!
docker run ${TTY_FLAGS} \
-v ${CONF_DIR}:${CONF_DIR}:ro \
-v ${WORKSPACE_DIR}:${WORKSPACE_DIR}:ro \
-v ${WORK_DIR}:${WORK_DIR}:rw \
-v /var/run/docker.sock:/var/run/docker.sock \
-e CONF_DIR="${CONF_DIR}" \
-e WORKSPACE_DIR="${WORKSPACE_DIR}" \
-e WORK_DIR="${WORK_DIR}" \
--workdir="${WORKSPACE_DIR}" \
infolinks/deployster:${VERSION} \
$@