This repository has been archived by the owner on Dec 5, 2021. It is now read-only.
forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 6
/
up_local.sh
executable file
·55 lines (45 loc) · 1.5 KB
/
up_local.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
#if ! [ -x "$(command -v yq)" ]; then
# echo 'Error: yq is not installed. brew install yq' >&2
# exit 1
#fi
if [[ $BUILD == 2 ]]; then
echo 'You set BUILD to 2, which means that we will use existing docker images on your computer'
fi
if [[ $BUILD == 1 ]]; then
echo 'You set BUILD to 1, which means that all your dockers will be (re)built'
fi
if [[ $BUILD == 0 ]]; then
echo 'You set BUILD to 0, which means that you want to pull Docker images from Dockerhub'
fi
if [[ $DAEMON == 1 ]]; then
echo 'You set DAEMON to 1, which means that your local L1/L2 will run in the background'
fi
if [[ $DAEMON == 0 ]]; then
echo 'You set DAEMON to 0, which means that your local L1/L2 will run in the front and you will see all the debug log information'
fi
#Build dependencies, if needed
if [[ $BUILD == 1 ]]; then
yarn
yarn build
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
DOCKERFILE="docker-compose.yml"
if [[ $BUILD == 1 ]]; then
docker-compose build --parallel -- builder l2geth l1_chain
docker-compose build --parallel -- deployer dtl batch_submitter relayer integration_tests
docker-compose build -- omgx_message-relayer-fast
docker-compose build -- gas_oracle
docker-compose build -- omgx_deployer
elif [[ $BUILD == 0 ]]; then
docker-compose -f $DIR/$DOCKERFILE pull
fi
if [[ $DAEMON == 1 ]]; then
docker-compose \
-f $DIR/$DOCKERFILE \
up --no-build --detach -V
else
docker-compose \
-f $DIR/$DOCKERFILE \
up --no-build -V
fi