forked from 0xakk0r0kamui/constant-chain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·53 lines (38 loc) · 1.84 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
#!/usr/bin/env bash
# if [ -z "$env" ]; then
# env="testnet";
# fi
# commit=`git show --summary --oneline | cut -d ' ' -f 1`
# if [[ $env == "testnet" ]]; then
# docker build --build-arg commit=$commit . -t incognitochaintestnet/incognito:${tag} && docker push incognitochaintestnet/incognito:${tag} && echo "Commit: $commit"
# elif [ $env == "mainnet" ]; then
# docker build --build-arg commit=$commit . -t incognitochain/incognito-mainnet:${tag} && docker push incognitochain/incognito-mainnet:${tag} && echo "Commit: $commit"
# fi
# docker rmi -f $(docker images --filter "dangling=true" -q)
#!/usr/bin/env bash
if [ -f ./incognito ]; then
rm -rf ./incognito
fi
if [ -f ./bootnode ]; then
rm -rf ./bootnode
fi
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '-w' -o incognito
echo "build execuable file successfully"
if [ -z "$env" ]; then
env="testnet";
fi
commit=`git show --summary --oneline | cut -d ' ' -f 1`
if [ $env = "testnet" ]; then
echo "build testnet"
DOCKER_BUILDKIT=1 docker build --build-arg commit=$commit . -t incognitochaintestnet/incognito:${tag} && docker push incognitochaintestnet/incognito:${tag} && echo "Commit: $commit"
elif [ $env = "mainnet" ]; then
echo "build mainnet"
docker build --build-arg commit=$commit . -t incognitochain/incognito-mainnet:${tag} && docker push incognitochain/incognito-mainnet:${tag} && echo "Commit: $commit"
elif [ $env == "fixednodes" ]; then
echo "build fixednodes"
docker build --build-arg commit=$commit . -t incognitochain/incognito-fixed-nodes:${tag} && docker push incognitochain/incognito-fixed-nodes:${tag} && echo "Commit: $commit"
elif [ $env = "local" ]; then
echo "build local"
DOCKER_BUILDKIT=1 docker build --build-arg commit=$commit . -t incognitochain:local
fi
docker rmi -f $(docker images --filter "dangling=true" -q)