diff --git a/Makefile b/Makefile index 5e4c9d01c..217f91d30 100644 --- a/Makefile +++ b/Makefile @@ -12,12 +12,8 @@ ACCEPTANCE_TESTS_FILE ?= ${DEST}/app-autoscaler-acceptance-tests-v$(VERSION).tgz # nix/packages.nix (the same pin the devbox env builds from), so the acceptance # release can be built in any environment with just awk — no running `cf` or a # pre-installed plugin required. Override by exporting AUTOSCALER_PLUGIN_VERSION. -AUTOSCALER_PLUGIN_VERSION ?= $(shell awk '\ - /app-autoscaler-cli-plugin = buildGoModule/{b=1} \ - b && /major *=/{gsub(/[^0-9]/,"");maj=$$0} \ - b && /minor *=/{gsub(/[^0-9]/,"");min=$$0} \ - b && /patch *=/{gsub(/[^0-9]/,"");pat=$$0;print maj"."min"."pat;exit}' \ - $(MAKEFILE_DIR)/nix/packages.nix) +AUTOSCALER_PLUGIN_VERSION ?= $(shell \ + nix eval --raw '.#app-autoscaler-cli-plugin.version') CI ?= false DEBUG := false diff --git a/mta.tpl.yaml b/mta.tpl.yaml index 0caa306a1..db06938d5 100644 --- a/mta.tpl.yaml +++ b/mta.tpl.yaml @@ -31,16 +31,7 @@ modules: build-parameters: builder: custom commands: # 🚧 To-do: embed me in the calling makefile - # `path: dbtasks` runs commands from dbtasks/; the make targets pushd into - # dbtasks/ and expect the repo root, so invoke make from the parent dir. - # `vendor-changelogs` copies the per-component *.db.changelog.{yml,yaml} - # into dbtasks/src/main/resources so `package` bundles them into the jar - # (they are .gitignored there, never committed). Running it here keeps a - # bare `mbt build` self-sufficient (rather than relying on it being run as - # an mta-build make prerequisite). Without it the apply-*-changelog deploy - # tasks fail with "BOOT-INF/classes/api.db.changelog.yml does not exist". - - make -C .. vendor-changelogs - - make -C .. dbtasks.clean package-dbtasks + - make dbtasks.clean package-dbtasks build-result: target/db-1.0-SNAPSHOT.jar requires: - name: database @@ -88,15 +79,7 @@ modules: build-parameters: builder: custom commands: - # Go modules ship SOURCE; the CF Go buildpack compiles at staging. It - # needs (a) the generated ogen `apis/scalinghistory` package, which is - # .gitignored and produced by `generate-openapi-...`, and (b) a `vendor/` - # dir so staging compiles air-gapped (the buildpack auto-uses vendor and - # makes no network calls). `go-mod-vendor-mta` does both (generate + - # `go mod vendor`). Running it here keeps a bare `mbt build` - # self-sufficient. Without it, apiserver/scalingengine fail staging with - # "no required module provides package .../apis/scalinghistory". - - make go-mod-vendor-mta + - echo "ignoring scheduler and dbtasks" > /dev/null ignore: ["acceptance", "build", "scheduler", "dbtasks", ".devbox", ".git", ".github", "nix", ".venv", ".claude"] requires: - name: apiserver-config @@ -121,9 +104,7 @@ modules: build-parameters: builder: custom commands: - # See the apiserver module: ships generated code + vendor/ for the - # air-gapped CF Go buildpack compile. - - make go-mod-vendor-mta + - echo "ignoring scheduler, dbtasks and scalingengine" > /dev/null ignore: ["acceptance", "build", "scheduler", "dbtasks", "scalingengine", ".devbox", ".git", ".github", "nix", ".venv", ".claude"] requires: - name: eventgenerator-config @@ -147,9 +128,7 @@ modules: build-parameters: builder: custom commands: - # See the apiserver module: ships generated code + vendor/ for the - # air-gapped CF Go buildpack compile. - - make go-mod-vendor-mta + - echo "ignoring scheduler and dbtasks" > /dev/null ignore: ["build", "scheduler", "dbtasks", ".devbox", ".git", ".github", "nix", ".venv", ".claude"] requires: - name: metricsforwarder-config @@ -174,9 +153,7 @@ modules: build-parameters: builder: custom commands: - # See the apiserver module: ships generated code + vendor/ for the - # air-gapped CF Go buildpack compile. - - make go-mod-vendor-mta + - echo "ignoring scheduler and dbtasks" > /dev/null ignore: ["acceptance", "build", "scheduler", "dbtasks", ".devbox", ".git", ".github", "nix", ".venv", ".claude"] requires: - name: metricsgateway-config @@ -200,9 +177,7 @@ modules: build-parameters: builder: custom commands: - # See the apiserver module: ships generated code + vendor/ for the - # air-gapped CF Go buildpack compile. - - make go-mod-vendor-mta + - echo "ignoring scheduler, dbtasks and eventgenerator" > /dev/null ignore: ["acceptance", "build", "scheduler", "dbtasks", "eventgenerator", ".devbox", ".git", ".github", "nix", ".venv", ".claude"] requires: - name: operator-config @@ -226,9 +201,7 @@ modules: build-parameters: builder: custom commands: - # See the apiserver module: ships generated code + vendor/ for the - # air-gapped CF Go buildpack compile. - - make go-mod-vendor-mta + - echo "ignoring scheduler, dbtasks and eventgenerator" > /dev/null ignore: ["acceptance", "build", "scheduler", "dbtasks", "eventgenerator", ".devbox", ".git", ".github", "nix", ".venv", ".claude"] requires: - name: scalingengine-config @@ -249,9 +222,7 @@ modules: build-parameters: builder: custom commands: # 🚧 To-do: embed me in the calling makefile - # `path: scheduler` runs commands from scheduler/; the make targets pushd - # into scheduler/ and expect the repo root, so invoke make from the parent. - - make -C .. scheduler.clean build-scheduler + - make scheduler.clean build-scheduler build-result: target/scheduler-1.0-SNAPSHOT.war properties: JBP_LOG_LEVEL: diff --git a/scripts/compile-acceptance-tests.sh b/scripts/compile-acceptance-tests.sh index bb9ef4806..52de9596c 100755 --- a/scripts/compile-acceptance-tests.sh +++ b/scripts/compile-acceptance-tests.sh @@ -17,7 +17,7 @@ read -ra ARCHITECTURES <<< "$ARCHITECTURES" # top level (not inside a function) so the EXIT trap can reference it safely even # under `set -u`, since the trap fires after main() returns and its locals are gone. GINKGO_TMPDIR="" -cleanup() { [[ -n "${GINKGO_TMPDIR}" ]] && rm -rf "${GINKGO_TMPDIR}"; } +cleanup() { [[ -n "${GINKGO_TMPDIR}" ]] && rm --recursive --force "${GINKGO_TMPDIR}"; } trap cleanup EXIT # Build the ginkgo tool from the version pinned in acceptance/go.mod into the @@ -60,7 +60,7 @@ main() { # Build the ginkgo tool once for the host platform into a temp dir, then use it # to cross-compile the suites. Absolute path so it works after `cd acceptance`. local ginkgo_bin - GINKGO_TMPDIR="$(mktemp -d)" + GINKGO_TMPDIR="$(mktemp --directory)" ginkgo_bin="${GINKGO_TMPDIR}/ginkgo" build_ginkgo "${ginkgo_bin}"