From 3aef3e1cf2313197157a1cec5521c094a7310f0c Mon Sep 17 00:00:00 2001 From: Silvestre Zabala Date: Tue, 3 Dec 2024 16:44:29 +0100 Subject: [PATCH] feat(ci): post-process uaac updates in nix package # Issue After renovate updates the Gemfile.lock for `uaac` the gemset.nix was left updated. # Fix Add post-processing step regenerating it with `bundix`. --- .../dependency-updates-post-processing.yaml | 13 +++++++++++-- Makefile | 12 ++++-------- nix/packages/uaac/Makefile | 11 +++++++++++ 3 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 nix/packages/uaac/Makefile diff --git a/.github/workflows/dependency-updates-post-processing.yaml b/.github/workflows/dependency-updates-post-processing.yaml index 47f50db2d2..291b3c66e6 100644 --- a/.github/workflows/dependency-updates-post-processing.yaml +++ b/.github/workflows/dependency-updates-post-processing.yaml @@ -11,8 +11,6 @@ jobs: name: "Dependency Updates Post-Processing" if: "!contains(github.event.pull_request.labels.*.name, 'skip-dependency-postprocessing')" runs-on: ubuntu-latest - container: - image: ghcr.io/cloudfoundry/app-autoscaler-release-tools:main permissions: pull-requests: write contents: write @@ -47,6 +45,16 @@ jobs: echo "commit_author_name=${commit_author_name}" >> $GITHUB_OUTPUT echo "commit_subject=${commit_subject}" >> $GITHUB_OUTPUT + + - name: Install devbox + uses: jetify-com/devbox-install-action@a03caf5813591bc882139eba6ae947930a83a427 # v0.11.0 + with: + enable-cache: 'true' + - name: Make devbox shellenv available + run: | + eval "$(devbox shellenv)" + printenv >> $GITHUB_ENV + - name: go-mod-tidy and make package-specs shell: bash env: @@ -83,6 +91,7 @@ jobs: # ⚠️ For this workflow to be successful, the subsequent line must not # trigger again the creation of the generated files. make package-specs + make update-uaac-nix-package declare -i -r num_changed_files="$(git status --porcelain | wc --lines)" if ((num_changed_files > 0)) diff --git a/Makefile b/Makefile index eb874f95f5..c759d499e9 100644 --- a/Makefile +++ b/Makefile @@ -310,18 +310,14 @@ changelog.go-mod-vendor: changeloglockcleander.go-mod-vendor: make --directory='${go-changeloglockcleander-dir}' go-mod-vendor - - -# https://github.com/golang/tools/blob/master/gopls/doc/workspace.md -.PHONY: workspace -workspace: - [ -e go.work ] || go work init - go work use $(addprefix ./src/,$(go_modules)) - .PHONY: uuac uaac: which uaac || gem install cf-uaac +.PHONY: update-uaac-nix-package +update-uaac-nix-package: + make --directory='./nix/packages/uaac' gemset.nix + .PHONY: deploy-autoscaler deploy-register-cf deploy-autoscaler-bosh deploy-cleanup deploy-autoscaler: go-mod-vendor uaac db scheduler deploy-autoscaler-bosh deploy-register-cf ## Deploy autoscaler to OSS dev environment deploy-register-cf: diff --git a/nix/packages/uaac/Makefile b/nix/packages/uaac/Makefile new file mode 100644 index 0000000000..fda3ed5519 --- /dev/null +++ b/nix/packages/uaac/Makefile @@ -0,0 +1,11 @@ +SHELL := /bin/bash +.SHELLFLAGS := -eu -o pipefail -c ${SHELLFLAGS} +.ONESHELL: + +.PHONY: gemset.nix +gemset.nix: Gemfile.lock ## Generate the gemset.nix file from the Gemfile.lock + bundix --lock + +help: ## Show this help + @grep --extended-regexp --no-filename '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' +