-
Notifications
You must be signed in to change notification settings - Fork 1
/
spacel.sh
executable file
·37 lines (31 loc) · 1.04 KB
/
spacel.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
31
32
33
34
35
36
#!/bin/bash
# Where to find AWS credentials:
AWS_CREDS_FILE="${HOME}/.aws/credentials"
if [ -f "$AWS_CREDS_FILE" ]; then
AWS_CREDS="-v ${AWS_CREDS_FILE}:/root/.aws/credentials"
else
echo "Unable to find AWS credentials"
exit 1
fi
# Pass through environment variables:
if [ -n "${SPACEL_ORBIT}" ]; then
SPACEL_ENV="${SPACEL_ENV} -e SPACEL_ORBIT=${SPACEL_ORBIT}"
fi
if [ -n "${SPACEL_APP}" ]; then
SPACEL_ENV="${SPACEL_ENV} -e SPACEL_APP=${SPACEL_APP}"
fi
if [ -n "${SPACEL_LOG_LEVEL}" ]; then
SPACEL_ENV="${SPACEL_ENV} -e SPACEL_LOG_LEVEL=${SPACEL_LOG_LEVEL}"
fi
if [ -n "${LAMBDA_BUCKET}" ]; then
SPACEL_ENV="${SPACEL_ENV} -e LAMBDA_BUCKET=${LAMBDA_BUCKET}"
fi
if [ -n "${LAMBDA_REGION}" ]; then
SPACEL_ENV="${SPACEL_ENV} -e LAMBDA_REGION=${LAMBDA_REGION}"
fi
if [ -n "${SPACEL_AGENT_CHANNEL}" ]; then
SPACEL_ENV="${SPACEL_ENV} -e SPACEL_AGENT_CHANNEL=${SPACEL_AGENT_CHANNEL}"
fi
# Which container to use:
SPACEL_CONTAINER="pebbletech/spacel-provision:latest"
docker run -i --rm ${AWS_CREDS} -v `pwd`:/pwd ${SPACEL_ENV} ${SPACEL_CONTAINER} "$@"