forked from ethereum-optimism/optimism-integration
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathup.sh
More file actions
executable file
·62 lines (55 loc) · 1.44 KB
/
up.sh
File metadata and controls
executable file
·62 lines (55 loc) · 1.44 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# Start services without the integration tests
# The `-s` flag takes a string of services to run.
# The `-l` flag will use mounted code.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
SERVICES=
DOCKERFILE="docker-compose.yml"
IS_LOCAL=
while (( "$#" )); do
case "$1" in
-l|--local)
DOCKERFILE="docker-compose.local.yml"
IS_LOCAL=true
shift 1
;;
-s|--services)
SERVICES="$2"
shift 2
;;
*)
echo "Unknown argument $1" >&2
shift
;;
esac
done
# If the services haven't been specified, parse
# the docker-compose files for the services.
# Run everything except for the integration tests
if [ -z "$SERVICES" ]; then
SERVICES=$(docker-compose \
-f $DIR/$DOCKERFILE \
-f $DIR/docker-compose.env.yml \
-f $DIR/optional/x-domain-service.yml \
config --services \
| grep -v integration_tests \
| tr '\n' ' ')
fi
if [ ! -z "$IS_LOCAL" ]; then
git submodule foreach \
'
BRANCH=$(git branch --show-current)
COMMIT=$(git rev-parse --short HEAD)
echo "$BRANCH $COMMIT"
'
fi
docker-compose \
-f $DIR/$DOCKERFILE \
-f $DIR/docker-compose.env.yml \
-f $DIR/optional/x-domain-service.yml \
down -v --remove-orphans
docker-compose \
-f $DIR/$DOCKERFILE \
-f $DIR/docker-compose.env.yml \
-f $DIR/optional/x-domain-service.yml \
up $SERVICES