Skip to content

Commit 2267a64

Browse files
committed
Merge remote-tracking branch 'origin/main' into 864-enable-eventgenerator-via-mtar
2 parents c47b44b + 4929a33 commit 2267a64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+660
-556
lines changed

.envrc

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@ then
88
# for more details
99
fi
1010

11-
local bbl_state_dir=../app-autoscaler-env-bbl-state/bbl-state
12-
if has bbl && [[ -d "$bbl_state_dir" ]]
13-
then
14-
BBL_STATE_DIRECTORY="$(realpath "$bbl_state_dir")"
15-
export BBL_STATE_DIRECTORY
16-
eval "$(bbl print-env)"
17-
fi
11+
local bbl_state_dir=${BBL_STATE_PATH:-'../app-autoscaler-env-bbl-state/bbl-state'}
12+
source './ci/autoscaler/scripts/common.sh'
13+
bosh_login "${bbl_state_dir}"
14+
echo '🚸 Login for bosh and concourse successful! For more execute: `make cf-login`'
1815

19-
export DBURL="postgres://postgres:postgres@localhost/autoscaler"
16+
export DBURL='postgres://postgres:postgres@localhost/autoscaler'

.github/workflows/mysql.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
DB_PASSWORD: root
2222
runs-on: "ubuntu-latest"
2323
container:
24-
image: "ubuntu:noble@sha256:1e622c5f073b4f6bfad6632f2616c7f59ef256e96fe78bf6a595d1dc4376ac02"
24+
image: "ubuntu:noble@sha256:6015f66923d7afbc53558d7ccffd325d43b4e249f41a6e93eef074c9505d2233"
2525
continue-on-error: true
2626
name: Build suite=${{ matrix.suite }}, mysql=${{ matrix.mysql }}
2727
services:

.github/workflows/postgres.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
DB_PASSWORD: postgres
2222
runs-on: "ubuntu-latest"
2323
container:
24-
image: "ubuntu:noble@sha256:1e622c5f073b4f6bfad6632f2616c7f59ef256e96fe78bf6a595d1dc4376ac02"
24+
image: "ubuntu:noble@sha256:6015f66923d7afbc53558d7ccffd325d43b4e249f41a6e93eef074c9505d2233"
2525
continue-on-error: true
2626
name: Build suite=${{ matrix.suite }}, postgres=${{ matrix.postgres }}
2727
services:

.gitignore

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# # Edit: Please use global git-ignore for this, see official hints in the description of gitignore
2+
# # on <https://git-scm.com/docs/gitignore>.
3+
#
4+
# # macOS system file that stores folder metadata (safe to ignore)
5+
# .DS_Store
6+
7+
8+
# ================================================================================
9+
# 🤖 Generated files
10+
# ================================================================================
11+
112
config/dev.yml
213
config/private.yml
314
releases/*.tgz
@@ -66,16 +77,11 @@ keys/
6677
.trunk
6778

6879

69-
# ==================== 📦 Devbox ====================
80+
# ==================== 📦 Devbox, ❄ Nix, direnv ====================
7081
.devbox
7182

72-
# ==================== ❄ Nix ====================
73-
7483
# Ignore links to build-output:
7584
/result
7685
/result-*
7786

7887
.direnv
79-
80-
# # macOS system file that stores folder metadata (safe to ignore)
81-
.DS_Store

Makefile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export GOWORK = off
3838
$(shell mkdir -p target)
3939
$(shell mkdir -p build)
4040

41-
.DEFAULT_GOAL := build-all
41+
.DEFAULT_GOAL := build_all
4242

4343
.PHONY: check-type
4444
check-db_type:
@@ -300,8 +300,11 @@ spec-test:
300300
bundle exec rspec
301301

302302
.PHONY: bosh-release
303-
bosh-release: go-mod-tidy go-mod-vendor scheduler db build/autoscaler-test.tgz
304-
build/autoscaler-test.tgz:
303+
bosh-release: build/autoscaler-test.tgz
304+
# 🚸 In the next line, the order of the dependencies is important. Generated code needs to be
305+
# already there for `go-mod-tidy` to work. See additional comment for that target in
306+
# ./src/autoscaler/Makefile.
307+
build/autoscaler-test.tgz: build_all go-mod-tidy go-mod-vendor
305308
@echo " - building bosh release into build/autoscaler-test.tgz"
306309
@mkdir -p build
307310
@bosh create-release --force --timestamp-version --tarball=build/autoscaler-test.tgz
@@ -370,7 +373,7 @@ deploy-autoscaler-bosh: db.java-libs go-mod-vendor scheduler.build
370373
echo " - deploying autoscaler"
371374
DEBUG="${DEBUG}" ${CI_DIR}/autoscaler/scripts/deploy-autoscaler.sh
372375
deploy-cleanup:
373-
${CI_DIR}/autoscaler/scripts/cleanup-autoscaler.sh;
376+
${CI_DIR}/autoscaler/scripts/cleanup-autoscaler.sh
374377

375378
bosh-release-path := ./target/bosh-releases
376379
prometheus-bosh-release-path := ${bosh-release-path}/prometheus
@@ -442,8 +445,11 @@ cleanup-autoscaler-deployments:
442445
@${CI_DIR}/autoscaler/scripts/cleanup-autoscaler-deployments.sh
443446

444447
.PHONY: cf-login
445-
cf-login: ## Login to OSS CF dev environment
446-
@${CI_DIR}/autoscaler/scripts/cf-login.sh
448+
cf-login:
449+
@echo '⚠️ Please note that this login only works for cf and concourse,' \
450+
'in spite of performing a login as well on bosh and credhub.' \
451+
'The necessary changes to the environment get lost when make exits its process.'
452+
@${CI_DIR}/autoscaler/scripts/os-infrastructure-login.sh
447453

448454
.PHONY: uaa-login
449455
uaa-login: ## Login to OSS CF dev environment
@@ -488,6 +494,7 @@ alerts-silence:
488494
${CI_DIR}/autoscaler/scripts/silence_prometheus_alert.sh BOSHJobEphemeralDiskPredictWillFill ;\
489495
${CI_DIR}/autoscaler/scripts/silence_prometheus_alert.sh BOSHJobUnhealthy ;
490496

497+
491498
.PHONY: docker-login docker docker-image
492499
docker-login: target/docker-login
493500
target/docker-login:
@@ -497,7 +504,6 @@ docker-image: docker-login
497504
docker build -t ghcr.io/cloudfoundry/app-autoscaler-release-tools:latest ci/dockerfiles/autoscaler-tools
498505
docker push ghcr.io/cloudfoundry/app-autoscaler-release-tools:latest
499506

500-
501507
validate-openapi-specs: $(wildcard ./api/*.openapi.yaml)
502508
for file in $^ ; do \
503509
redocly lint --extends=minimal --format=$(if $(GITHUB_ACTIONS),github-actions,codeframe) "$${file}" ; \

ci/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# ================================================================================
2+
# 🤖 Generated files
3+
# ================================================================================

ci/Makefile

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
.ONESHELL:
2+
SHELL := /bin/bash
3+
.SHELLFLAGS := -eu -o pipefail -c
4+
5+
repository-root := $(shell realpath --relative-to $$(pwd) $$(git rev-parse --show-toplevel))
6+
7+
# All files that together define the development-environment:
8+
development-environment-definition := \
9+
$(wildcard ${repository-root}/nix/**/*) \
10+
${repository-root}/devbox.json \
11+
${repository-root}/devbox.lock
12+
13+
# 🚸 Overwrite the following parameters to work with a different repository on a different registry:
14+
OCI_REGISTRY ?= ghcr.io
15+
OCI_REPOSITORY ?= cloudfoundry/app-autoscaler-release-tools
16+
OCI_TAG ?= main
17+
18+
.PHONY: docker-login
19+
docker-login:
20+
@logged_in=$$(jq '.auths | has("${OCI_REGISTRY}")' ~/.docker/config.json)
21+
readonly logged_in
22+
if [[ "$${logged_in}" != 'true' ]]
23+
then
24+
docker login '${OCI_REGISTRY}'
25+
else
26+
echo 'Already logged in into ${OCI_REGISTRY}, skipping login.'
27+
fi
128

229
.PHONY: set-autoscaler-pipeline
330
set-autoscaler-pipeline:
@@ -15,10 +42,6 @@ unpause-pipeline:
1542
delete-pipeline:
1643
@./scripts/delete-pipeline.sh
1744

18-
.PHONY: set-target
19-
set-target:
20-
@fly --target app-autoscaler-release login --team-name app-autoscaler --concourse-url https://concourse.app-runtime-interfaces.ci.cloudfoundry.org
21-
2245
.PHONY: lint
2346
lint:
2447
@shellcheck --external-sources --shell='bash' **/scripts/*.sh

0 commit comments

Comments
 (0)