File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash -e
2
+ #
3
+ # A utility script for executing arbitrary local scripts via docker.
4
+ # This can be used for executing build/release scripts locally in our build container in the absence of Jenkins.
5
+ #
6
+ # USAGE:
7
+ #
8
+ # With env vars:
9
+ # MYVAR=foo OTHERVAR=bar DOCKER_ENV=MYVAR,OTHERVAR ./builder-run ./my-script --my-script-arg1 --my-script-arg2
10
+ #
11
+ # Without env vars:
12
+ # ./builder-run ./my-script --my-script-arg1 --my-script-arg2
13
+
14
+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
15
+
16
+ # forward whitelisted env variables to docker
17
+ ENV_STR=" "
18
+ for VAR in ${DOCKER_ENV// ,/ } ; do
19
+ ENV_STR=" $ENV_STR -e $VAR =${! VAR} "
20
+ done
21
+
22
+ PROJECT=$SCRIPT_DIR
23
+ set -x
24
+ docker run --user=" ${BUILDER_RUN_USER} " $ENV_STR --rm -v $PROJECT :/go/src/github.com/coreos/tectonic-installer -w /go/src/coreos/tectonic-installer $DOCKER_RUN_ARGS $BUILDER_IMAGE $@
You can’t perform that action at this time.
0 commit comments