-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
59 lines (39 loc) · 1.11 KB
/
deploy.sh
File metadata and controls
59 lines (39 loc) · 1.11 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
#!/bin/bash
# deploy tendermint on our cluster
LOCAL_DEPLOY_REPO_PATH=$HOME/tendermint
TENDERMINT_BUILD_DIR=$GOPATH/src/github.com/tendermint
# create required directories
rm -rf ${TENDERMINT_BUILD_DIR}
rm -rf ${LOCAL_DEPLOY_REPO_PATH}
mkdir -p ${TENDERMINT_BUILD_DIR}
mkdir -p ${LOCAL_DEPLOY_REPO_PATH}
cd ${LOCAL_DEPLOY_REPO_PATH}
git init --bare
# create the post-receive hook
cd hooks || exit
tee post-receive <<EOF
#!/bin/bash
export GOBIN=/var/nfs/gobin
export PATH=$PATH:$GOBIN
# tendermint build directory
TENDERMINT_BUILD_DIR=${TENDERMINT_BUILD_DIR}
LOCAL_DEPLOY_REPO_PATH=${LOCAL_DEPLOY_REPO_PATH}
cd \${TENDERMINT_BUILD_DIR}
unset GIT_DIR
# delete the existing directory
rm -rf tendermint
git clone ${LOCAL_DEPLOY_REPO_PATH}
# build tendermint
cd tendermint || exit
echo "waiting 5s before building tendermint"
./cluster.sh down
make get_tools && make get_vendor_deps
make && make install
# copy the config files to nfs
rm -rf /var/nfs/tendermint_config
cp -a tendermint_config /var/nfs/
# restart the tendermint cluster
./cluster.sh restart
EOF
# make the post-receive hook executable
chmod +x post-receive