Skip to content

Commit

Permalink
feat: generate a single extensions information file for all extensions
Browse files Browse the repository at this point in the history
Get all extensions manifests from all subfolders and put them into a
single file to help with the scenario when it's necessary to read all
possible extensions information.

Signed-off-by: Artem Chernyshev <[email protected]>
  • Loading branch information
Unix4ever committed Dec 19, 2023
1 parent 32f106f commit 3104df1
Show file tree
Hide file tree
Showing 4 changed files with 413 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2023-12-12T23:07:05Z by kres latest.
# Generated on 2023-12-19T16:28:49Z by kres latest.

name: default
concurrency:
Expand Down Expand Up @@ -90,6 +90,9 @@ jobs:
})
return resp.data.labels.map(label => label.name)
- name: check-dirty
run: |
make check-dirty
- name: extensions
if: github.event_name != 'pull_request'
env:
Expand Down
30 changes: 30 additions & 0 deletions .kres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ spec:
kind: auto.CustomSteps
spec:
steps:
- name: check-dirty
toplevel: true
- name: extensions
toplevel: true
- name: extensions-metadata
Expand All @@ -58,6 +60,8 @@ spec:
toplevel: true
- name: sign-images
toplevel: true
- name: extensions-info
toplevel: true
---
kind: custom.Step
name: extensions
Expand Down Expand Up @@ -96,6 +100,32 @@ spec:
@$(foreach target,$(NONFREE_TARGETS),echo $(REGISTRY)/$(USERNAME)/$(target):$(shell $(ARTIFACTS)/bldr eval --target $(target) --build-arg TAG=$(TAG) '{{.VERSION}}' 2>/dev/null) >> _out/extensions-metadata;)
---
kind: custom.Step
name: extensions-info
spec:
makefile:
enabled: true
phony: true
depends:
- $(ARTIFACTS)/bldr
script:
- |
@find ./ -name "manifest.yaml" -print0 | env LC_ALL=en_US sort -z | xargs -r0 -I{} sh -c 'echo "---\\n$$(cat {})"' > extensions.yaml
---
kind: custom.Step
name: check-dirty
spec:
makefile:
enabled: true
phony: true
depends:
- extensions-info
script:
- |
@if test -n "`git status --porcelain`"; then echo "Source tree is dirty"; git status; git diff; exit 1 ; fi
ghaction:
enabled: true
---
kind: custom.Step
name: internal/extensions/image-digests
spec:
makefile:
Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2023-12-14T14:59:37Z by kres latest.
# Generated on 2023-12-19T15:09:45Z by kres latest.

# common variables

Expand Down Expand Up @@ -163,6 +163,10 @@ $(ARTIFACTS)/bldr: $(ARTIFACTS) ## Downloads bldr binary.
deps.png: ## Generates a dependency graph of the Pkgfile.
@$(BLDR) graph | dot -Tpng -o deps.png

.PHONY: check-dirty
check-dirty: extensions-info
@if test -n "`git status --porcelain`"; then echo "Source tree is dirty"; git status; git diff; exit 1 ; fi

.PHONY: extensions
extensions: internal/extensions/image-digests
@$(MAKE) docker-$@ TARGET_ARGS="--tag=$(EXTENSIONS_IMAGE_REF) --push=$(PUSH)"
Expand All @@ -185,6 +189,10 @@ sign-images:
cosign sign --yes $$image; \
done

.PHONY: extensions-info
extensions-info: $(ARTIFACTS)/bldr
@find ./ -name "manifest.yaml" -print0 | env LC_ALL=en_US sort -z | xargs -r0 -I{} sh -c 'echo "---\\n$$(cat {})"' > extensions.yaml

.PHONY: rekres
rekres:
@docker pull $(KRES_IMAGE)
Expand Down
Loading

0 comments on commit 3104df1

Please sign in to comment.