This repository was archived by the owner on Mar 19, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (48 loc) · 2.77 KB
/
Copy pathMakefile
File metadata and controls
60 lines (48 loc) · 2.77 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
60
SHELL:=/bin/bash
MAKEFILE_DIR:=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
.EXPORT_ALL_VARIABLES:
.PHONY: build
SYSTEM_TEST_SHA=$(shell git rev-parse HEAD)
STELLAR_CLI_STAGE_IMAGE=stellar/system-test-stellar-cli:dev
# The rest of these variables can be set as environment variables to the makefile
# to modify how system test is built.
# variables to set for source code, can be any valid docker context url local
# path github remote repo `https://github.com/repo#<ref>`
STELLAR_CLI_GIT_REF=https://github.com/stellar/stellar-cli.git\#main
# if crate version is set, then it overrides STELLAR_CLI_GIT_REF, cli will be installed from this create instead
STELLAR_CLI_CRATE_VERSION=
# variables to set if wanting to use existing dockerhub images instead of compiling
# image during build. if using this option, the image ref should provide a version for same
# platform arch as the build host is on, i.e. linux/amd64 or linux/arm64.
#
# image must have soroban cli bin at /usr/local/cargo/bin/soroban
STELLAR_CLI_IMAGE=
# defauult node version to install in system test image
NODE_VERSION?=20.19.4
# specify the published npm repo version of soroban-client js library,
# or you can specify gh git ref url as the version
JS_STELLAR_SDK_NPM_VERSION=https://github.com/stellar/js-stellar-sdk.git\#master
# sets the rustc version in the system test image
RUST_TOOLCHAIN_VERSION=stable
# the final image name that is created in local docker images store for system test
SYSTEM_TEST_IMAGE=stellar/system-test:dev
build-stellar-cli:
if [ -z "$(STELLAR_CLI_IMAGE)" ]; then \
DOCKERHUB_RUST_VERSION=rust:$$( [ "$(RUST_TOOLCHAIN_VERSION)" = "stable" ] && echo "latest" || echo "$(RUST_TOOLCHAIN_VERSION)"); \
DOCKER_CONTEXT=$$( [ -z "$(STELLAR_CLI_CRATE_VERSION)" ] && echo "$(STELLAR_CLI_GIT_REF)" || echo "." ); \
docker build --progress=plain -t "$(STELLAR_CLI_STAGE_IMAGE)" --target builder \
--build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \
--build-arg DOCKERHUB_RUST_VERSION="$$DOCKERHUB_RUST_VERSION" \
--build-arg STELLAR_CLI_CRATE_VERSION="$(STELLAR_CLI_CRATE_VERSION)" \
-f- $$DOCKER_CONTEXT < $(MAKEFILE_DIR)Dockerfile.stellar-cli; \
fi
build: build-stellar-cli
STELLAR_CLI_IMAGE_REF=$$( [ -z "$(STELLAR_CLI_IMAGE)" ] && echo "$(STELLAR_CLI_STAGE_IMAGE)" || echo "$(STELLAR_CLI_IMAGE)"); \
docker build --progress=plain -t "$(SYSTEM_TEST_IMAGE)" -f Dockerfile \
--build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true \
--build-arg STELLAR_CLI_CRATE_VERSION=$(STELLAR_CLI_CRATE_VERSION) \
--build-arg STELLAR_CLI_IMAGE_REF=$$STELLAR_CLI_IMAGE_REF \
--build-arg RUST_TOOLCHAIN_VERSION=$(RUST_TOOLCHAIN_VERSION) \
--build-arg NODE_VERSION=$(NODE_VERSION) \
--build-arg JS_STELLAR_SDK_NPM_VERSION=$(JS_STELLAR_SDK_NPM_VERSION) \
--label org.opencontainers.image.revision="$(SYSTEM_TEST_SHA)" .; \