forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·35 lines (29 loc) · 887 Bytes
/
run.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
#!/usr/bin/env bash
# run.sh
#
# SUMMARY
#
# A simple script that runs commands in a container environment based
# on the presence of the `USE_CONTAINER` environment variable.
#
# This helps to reduce the friction running various `make`
# commands. For example, the `make generate` command requires Ruby and
# other dependencies to be installed. Routing this command through a
# container images removes this.
set -eou pipefail
case "$USE_CONTAINER" in
docker | podman)
echo "Executing within $USE_CONTAINER. To disable set USE_CONTAINER to none"
echo ""
echo " make ... USE_CONTAINER=none"
echo ""
scripts/docker-run.sh "$@"
;;
*)
echo "Executing locally. To use Docker set USE_CONTAINER to docker or podman"
echo ""
echo " make ... USE_CONTAINER=docker"
echo " make ... USE_CONTAINER=podman"
echo ""
${@:2}
esac