Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Comment on lines +15 to +16

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could cause issues on classical cloudMbt-build-images as nix is not available there.

CI ?= false

DEBUG := false
Expand Down
45 changes: 8 additions & 37 deletions mta.tpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still needs the --directory.

build-result: target/scheduler-1.0-SNAPSHOT.war
properties:
JBP_LOG_LEVEL:
Expand Down
4 changes: 2 additions & 2 deletions scripts/compile-acceptance-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}"

Expand Down
Loading