-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
34 lines (28 loc) · 1.2 KB
/
Makefile
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
include .env
export $(shell sed 's/=.*//' .env)
.ONESHELL:
.PHONY: test
test:
npm run truffle
deploy-ropsten:
npm run deploy_ropsten 2>&1| tee deploy.output
verify-ropsten:
./node_modules/.bin/truffle run verify Atomex@$$ATOMEX_ADDRESS --network ropsten
github-deployment:
CONTRACT_ADDRESS=$$(cat deploy.output | grep "contract address" | awk '{ print $$4 }' | tail -2 | head -1)
ETHERSCAN_URL=https://ropsten.etherscan.io/address/$$CONTRACT_ADDRESS
echo "Check out deployed contract at $$ETHERSCAN_URL"
curl -0 -X POST https://api.github.com/repos/$$TRAVIS_REPO_SLUG/deployments \
-H "Accept: application/vnd.github.ant-man-preview+json" \
-H "Authorization: token $$GH_TOKEN" \
-d "{ \"ref\": \"master\", \"environment\": \"ropsten\", \"required_contexts\": [] }" \
2>&1| tee deployment.output
STATUSES_URL="$$(cat deployment.output | grep statuses_url | awk -F\" '{ print $$4 }')"
curl -0 -X POST $$STATUSES_URL \
-H "Accept: application/vnd.github.ant-man-preview+json" \
-H "Authorization: token $$GH_TOKEN" \
-d "{ \"state\": \"success\", \"environment\": \"ropsten\", \"environment_url\": \"$$ETHERSCAN_URL\" }"
ropsten:
$(MAKE) deploy-ropsten
$(MAKE) github-deployment
npm run verify_ropsten