forked from mozilla-iam/auth0-custom-lock
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdmake
More file actions
executable file
·36 lines (30 loc) · 1.01 KB
/
dmake
File metadata and controls
executable file
·36 lines (30 loc) · 1.01 KB
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
# Use this script to run the makefile within a docker container
AWS_CREDS_DIR="$HOME/.aws"
DOCKER_PROJECT_DIR="/nlx"
IMG_NAME="auth0-custom-lock-builder"
HUB="mozillaiam"
CONTAINER_NAME="$IMG_NAME-container"
function usage() {
echo "Build make targets in a container (${IMG_NAME})"
echo "$0 make <make target>"
exit 127
}
function check_img() {
docker image ls ${IMG_NAME} 2>&1 > /dev/null && return 0
echo "Cannot find docker image ${IMG_NAME}."
echo "Please run \`make dkrbuild\` to build it, or \`docker pull ${HUB}/${IMG_NAME}\`".
return 1
}
[[ $# -eq 0 ]] && usage
check_img || exit 127
exec docker run --rm --name ${CONTAINER_NAME} \
-u $(id -u) \
-v ${AWS_CREDS_DIR}:/root/.aws \
-v $(pwd):${DOCKER_PROJECT_DIR} \
-e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" \
-e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" \
-e "AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}" \
-e "AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}" \
-e "CLIENT_SECRET=${CLIENT_SECRET}" \
${HUB}/${IMG_NAME}:latest make $@