forked from PowerLoom/deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·81 lines (62 loc) · 2.04 KB
/
build.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
source .env
echo "testing before build...";
if [ -z "$SOURCE_RPC_URL" ]; then
echo "RPC URL not found, please set this in your .env!";
exit 1;
fi
if [ -z "$SIGNER_ACCOUNT_ADDRESS" ]; then
echo "SIGNER_ACCOUNT_ADDRESS not found, please set this in your .env!";
exit 1;
fi
if [ -z "$SIGNER_ACCOUNT_PRIVATE_KEY" ]; then
echo "SIGNER_ACCOUNT_ADDRESS not found, please set this in your .env!";
exit 1;
fi
echo "Found SOURCE RPC URL ${SOURCE_RPC_URL}";
echo "Found SIGNER ACCOUNT ADDRESS ${SIGNER_ACCOUNT_ADDRESS}";
if [ "$CODESPACE_NAME" ]; then
export POOLER_API_PREFIX="https://${CODESPACE_NAME}-8002.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}";
echo "Running in Github codespace, autofilling POOLER_API_PREFIX..";
fi
if [ "$POOLER_API_PREFIX" ]; then
echo "Found POOLER_API_PREFIX ${POOLER_API_PREFIX}";
fi
if [ "$PROST_RPC_URL" ]; then
echo "Found PROST_RPC_URL ${PROST_RPC_URL}";
fi
if [ "$IPFS_URL" ]; then
echo "Found IPFS_URL ${IPFS_URL}";
fi
if [ "$PROTOCOL_STATE_CONTRACT" ]; then
echo "Found PROTOCOL_STATE_CONTRACT ${PROTOCOL_STATE_CONTRACT}";
fi
if [ "$RELAYER_HOST" ]; then
echo "Found RELAYER_HOST ${RELAYER_HOST}";
fi
if [ "$WEB3_STORAGE_TOKEN" ]; then
echo "Found WEB3_STORAGE_TOKEN ${WEB3_STORAGE_TOKEN}";
fi
if [ "$SLACK_REPORTING_URL" ]; then
echo "Found SLACK_REPORTING_URL ${SLACK_REPORTING_URL}";
fi
if [ "$POWERLOOM_REPORTING_URL" ]; then
echo "Found SLACK_REPORTING_URL ${POWERLOOM_REPORTING_URL}";
fi
echo "building...";
if ! [ -x "$(command -v docker-compose)" ]; then
echo 'docker compose not found, trying to see if compose exists within docker';
docker compose pull;
if [ -z "$IPFS_URL" ]; then
docker compose --profile ipfs up -V --abort-on-container-exit
else
docker compose up --no-deps -V --abort-on-container-exit
fi
else
docker-compose pull;
if [ -z "$IPFS_URL" ]; then
docker-compose --profile ipfs up -V --abort-on-container-exit
else
docker-compose up --no-deps -V --abort-on-container-exit
fi
fi