|
1 | | -__PHONY__: run logs build build-deps build-deps-core build-deps-horizon build-deps-friendbot build-deps-stellar-rpc |
| 1 | +__PHONY__: run logs console build build-deps build-deps-xdr build-deps-core build-deps-horizon build-deps-friendbot build-deps-rpc build-deps-lab |
2 | 2 |
|
3 | 3 | REVISION=$(shell git -c core.abbrev=no describe --always --exclude='*' --long --dirty) |
4 | | -TAG?=dev |
5 | | -PROTOCOL_VERSION_DEFAULT?=22 |
6 | | -XDR_REPO?=stellar/rs-stellar-xdr |
7 | | -XDR_REF?=main |
8 | | -CORE_REPO?=stellar/stellar-core |
9 | | -CORE_REF?=master |
10 | | -CORE_CONFIGURE_FLAGS?=--disable-tests |
11 | | -STELLAR_RPC_REF?=main |
12 | | -HORIZON_REF?=master |
13 | | -FRIENDBOT_REF?=$(HORIZON_REF) |
14 | | -LAB_REF?=main |
| 4 | +TAG?=latest |
| 5 | + |
| 6 | +# Extract configuration from images.json |
| 7 | +PROTOCOL_VERSION_DEFAULT = $(shell jq -r '.[] | select(.tag == "$(TAG)") | .config.protocol_version_default' images.json) |
| 8 | +XDR_REPO = $(shell jq -r '.[] | select(.tag == "$(TAG)") | .deps[] | select(.name == "xdr") | .repo' images.json) |
| 9 | +XDR_REF = $(shell jq -r '.[] | select(.tag == "$(TAG)") | .deps[] | select(.name == "xdr") | .ref' images.json) |
| 10 | +CORE_REPO = $(shell jq -r '.[] | select(.tag == "$(TAG)") | .deps[] | select(.name == "core") | .repo' images.json) |
| 11 | +CORE_REF = $(shell jq -r '.[] | select(.tag == "$(TAG)") | .deps[] | select(.name == "core") | .ref' images.json) |
| 12 | +CORE_OPTIONS = $(shell jq -c '.[] | select(.tag == "$(TAG)") | .deps[] | select(.name == "core") | .options // {}' images.json) |
| 13 | +RPC_REPO = $(shell jq -r '.[] | select(.tag == "$(TAG)") | .deps[] | select(.name == "rpc") | .repo' images.json) |
| 14 | +RPC_REF = $(shell jq -r '.[] | select(.tag == "$(TAG)") | .deps[] | select(.name == "rpc") | .ref' images.json) |
| 15 | +HORIZON_REPO = $(shell jq -r '.[] | select(.tag == "$(TAG)") | .deps[] | select(.name == "horizon") | .repo' images.json) |
| 16 | +HORIZON_REF = $(shell jq -r '.[] | select(.tag == "$(TAG)") | .deps[] | select(.name == "horizon") | .ref' images.json) |
| 17 | +FRIENDBOT_REPO = $(shell jq -r '.[] | select(.tag == "$(TAG)") | .deps[] | select(.name == "friendbot") | .repo' images.json) |
| 18 | +FRIENDBOT_REF = $(shell jq -r '.[] | select(.tag == "$(TAG)") | .deps[] | select(.name == "friendbot") | .ref' images.json) |
| 19 | +LAB_REPO = $(shell jq -r '.[] | select(.tag == "$(TAG)") | .deps[] | select(.name == "lab") | .repo' images.json) |
| 20 | +LAB_REF = $(shell jq -r '.[] | select(.tag == "$(TAG)") | .deps[] | select(.name == "lab") | .ref' images.json) |
15 | 21 |
|
16 | 22 | run: |
17 | | - docker run --rm --name stellar -p 8000:8000 stellar/quickstart:$(TAG) --local --enable-stellar-rpc |
| 23 | + docker run --rm --name stellar -p 8000:8000 stellar/quickstart:$(TAG) --local |
18 | 24 |
|
19 | 25 | logs: |
20 | 26 | docker exec stellar /bin/sh -c 'tail -F /var/log/supervisor/*' |
21 | 27 |
|
22 | 28 | console: |
23 | 29 | docker exec -it stellar /bin/bash |
24 | 30 |
|
25 | | -build-latest: |
26 | | - $(MAKE) build TAG=latest \ |
27 | | - PROTOCOL_VERSION_DEFAULT=23 \ |
28 | | - XDR_REF=v23.0.0 \ |
29 | | - CORE_REF=v23.0.1 \ |
30 | | - HORIZON_REF=horizon-v23.0.0 \ |
31 | | - STELLAR_RPC_REF=v23.0.4 \ |
32 | | - FRIENDBOT_REF=horizon-v23.0.0 |
33 | | - |
34 | | -build-testing: |
35 | | - $(MAKE) build TAG=testing \ |
36 | | - PROTOCOL_VERSION_DEFAULT=23 \ |
37 | | - XDR_REF=v23.0.0 \ |
38 | | - CORE_REF=v23.0.1 \ |
39 | | - HORIZON_REF=horizon-v23.0.0 \ |
40 | | - STELLAR_RPC_REF=v23.0.4 \ |
41 | | - FRIENDBOT_REF=horizon-v23.0.0 |
42 | | - |
43 | | -build-future: |
44 | | - $(MAKE) build TAG=future \ |
45 | | - PROTOCOL_VERSION_DEFAULT=23 \ |
46 | | - XDR_REF=v23.0.0 \ |
47 | | - CORE_REF=v23.0.1 \ |
48 | | - HORIZON_REF=horizon-v23.0.0 \ |
49 | | - STELLAR_RPC_REF=v23.0.4 \ |
50 | | - FRIENDBOT_REF=horizon-v23.0.0 |
51 | | - |
52 | 31 | build: |
53 | | - $(MAKE) -j 4 build-deps |
| 32 | + < images.json jq -c --arg tag '$(TAG)' '.[] | select(.tag == $$tag)' > image.json |
| 33 | + $(MAKE) build-deps |
54 | 34 | docker build -t stellar/quickstart:$(TAG) -f Dockerfile . \ |
55 | 35 | --build-arg REVISION=$(REVISION) \ |
56 | 36 | --build-arg PROTOCOL_VERSION_DEFAULT=$(PROTOCOL_VERSION_DEFAULT) \ |
57 | | - --build-arg STELLAR_XDR_IMAGE_REF=stellar-xdr:$(XDR_REF) \ |
58 | | - --build-arg STELLAR_CORE_IMAGE_REF=stellar-core:$(CORE_REF) \ |
| 37 | + --build-arg XDR_IMAGE_REF=stellar-xdr:$(XDR_REF) \ |
| 38 | + --build-arg CORE_IMAGE_REF=stellar-core:$(CORE_REF) \ |
| 39 | + --build-arg RPC_IMAGE_REF=stellar-rpc:$(RPC_REF) \ |
59 | 40 | --build-arg HORIZON_IMAGE_REF=stellar-horizon:$(HORIZON_REF) \ |
60 | 41 | --build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:$(FRIENDBOT_REF) \ |
61 | | - --build-arg STELLAR_RPC_IMAGE_REF=stellar-rpc:$(STELLAR_RPC_REF) \ |
62 | 42 | --build-arg LAB_IMAGE_REF=stellar-lab:$(LAB_REF) |
63 | 43 |
|
64 | | -build-deps: build-deps-xdr build-deps-core build-deps-horizon build-deps-friendbot build-deps-stellar-rpc build-deps-lab |
| 44 | +build-deps: build-deps-xdr build-deps-rpc build-deps-horizon build-deps-friendbot build-deps-lab build-deps-core |
65 | 45 |
|
66 | 46 | build-deps-xdr: |
67 | 47 | docker build -t stellar-xdr:$(XDR_REF) -f Dockerfile.xdr . --build-arg REPO="$(XDR_REPO)" --build-arg REF="$(XDR_REF)" |
68 | 48 |
|
69 | 49 | build-deps-core: |
70 | | - docker build -t stellar-core:$(CORE_REF) -f Dockerfile.core . --build-arg REPO="$(CORE_REPO)" --build-arg REF="$(CORE_REF)" --build-arg CONFIGURE_FLAGS="$(CORE_CONFIGURE_FLAGS)" |
| 50 | + docker build -t stellar-core:$(CORE_REF) -f Dockerfile.core . --build-arg REPO="$(CORE_REPO)" --build-arg REF="$(CORE_REF)" --build-arg OPTIONS='$(CORE_OPTIONS)' |
| 51 | + |
| 52 | +build-deps-rpc: |
| 53 | + docker build -t stellar-rpc:$(RPC_REF) -f Dockerfile.rpc . --build-arg=REPO="$(RPC_REPO)" --build-arg REF="$(RPC_REF)" |
71 | 54 |
|
72 | 55 | build-deps-horizon: |
73 | | - docker build -t stellar-horizon:$(HORIZON_REF) -f Dockerfile.horizon . --build-arg REF="$(HORIZON_REF)" |
| 56 | + docker build -t stellar-horizon:$(HORIZON_REF) -f Dockerfile.horizon . --build-arg REPO="$(HORIZON_REPO)" --build-arg REF="$(HORIZON_REF)" |
74 | 57 |
|
75 | 58 | build-deps-friendbot: |
76 | | - docker build -t stellar-friendbot:$(FRIENDBOT_REF) -f Dockerfile.friendbot . --build-arg REF="$(FRIENDBOT_REF)" |
77 | | - |
78 | | -build-deps-stellar-rpc: |
79 | | - docker build -t stellar-rpc:$(STELLAR_RPC_REF) -f Dockerfile.rpc . --build-arg REF="$(STELLAR_RPC_REF)" |
| 59 | + docker build -t stellar-friendbot:$(FRIENDBOT_REF) -f Dockerfile.friendbot . --build-arg REPO="$(FRIENDBOT_REPO)" --build-arg REF="$(FRIENDBOT_REF)" |
80 | 60 |
|
81 | 61 | build-deps-lab: |
82 | | - docker build -t stellar-lab:$(LAB_REF) -f Dockerfile.lab . --build-arg NEXT_PUBLIC_COMMIT_HASH=$(LAB_REF) |
| 62 | + docker build -t stellar-lab:$(LAB_REF) -f Dockerfile.lab . --build-arg REPO="$(LAB_REPO)" --build-arg NEXT_PUBLIC_COMMIT_HASH=$(LAB_REF) |
0 commit comments