forked from SO4-Markets/contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.mk
More file actions
32 lines (23 loc) · 1.43 KB
/
Copy pathdeploy.mk
File metadata and controls
32 lines (23 loc) · 1.43 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
# Deployment workflows.
.PHONY: deploy deploy-all deploy-contract deploy-force deploy-testnet deploy-mainnet deploy-local addresses
deploy: deploy-all
deploy-all: preflight
CONTRACT="$(CONTRACT)" bash scripts/deploy.sh "$(NETWORK)" "$(SOURCE)"
deploy-force: preflight
CONTRACT="$(CONTRACT)" FORCE=1 bash scripts/deploy.sh "$(NETWORK)" "$(SOURCE)"
deploy-contract: preflight build
@test -n "$(CONTRACT)" || { printf '%s\n' 'Usage: make deploy-contract CONTRACT=reader NETWORK=testnet SOURCE=deployer'; exit 1; }
@test -f "$(WASM_DIR)/$(CONTRACT).wasm" || { printf 'Missing wasm: %s/%s.wasm\n' "$(WASM_DIR)" "$(CONTRACT)"; exit 1; }
wasm_hash="$$(stellar contract upload --wasm "$(WASM_DIR)/$(CONTRACT).wasm" --source "$(SOURCE)" --network "$(NETWORK)")"
contract_id="$$(stellar contract deploy --wasm-hash "$$wasm_hash" --source "$(SOURCE)" --network "$(NETWORK)")"
printf '%s deployed at %s\n' "$(CONTRACT)" "$$contract_id"
printf '%s\n' 'This standalone deploy did not update $(DEPLOY_ENV). Initialize and wire it manually, or use upgrade-contract for an existing protocol deployment.'
deploy-testnet:
$(MAKE) deploy-all NETWORK=testnet SOURCE="$(SOURCE)"
deploy-mainnet:
$(MAKE) deploy-all NETWORK=mainnet SOURCE="$(SOURCE)"
deploy-local:
$(MAKE) deploy-all NETWORK=local SOURCE="$(SOURCE)"
addresses:
@test -f "$(DEPLOY_ENV)" || { printf 'Missing %s. Run make deploy-all first.\n' "$(DEPLOY_ENV)"; exit 1; }
@sed -n '1,220p' "$(DEPLOY_ENV)"