Skip to content
Merged
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
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3386,6 +3386,7 @@
- "tailscale-operator"
- "tektoncd"
- "teleport-operator"
- "tinkerbell"
- "traefik"
- "triggermesh"
- "trust-manager"
Expand Down Expand Up @@ -3708,6 +3709,46 @@
"SSH_KEY": "${{ secrets.DEPLOY_KEY }}"
"if": "steps.filter.outputs.workflows == 'true'"
"run": "make libs/teleport-operator"
"tinkerbell":
"name": "Generate tinkerbell Jsonnet library and docs"
"needs":
- "build"
- "repos"
"runs-on": "ubuntu-latest"
"steps":
- "uses": "actions/checkout@v4"
- "id": "filter"
"uses": "dorny/paths-filter@v3"
"with":
"filters": |
workflows:
- '.github/**'
- 'bin/**'
- 'Dockerfile'
- 'go.mod'
- 'go.sum'
- 'jsonnet/**'
- 'main.go'
- 'Makefile'
- 'pkg/**'
- 'scripts/**'
- 'tf/**'
- 'libs/tinkerbell/**'
- "if": "steps.filter.outputs.workflows == 'true'"
"uses": "actions/download-artifact@v4"
"with":
"name": "docker-artifact"
"path": "artifacts"
- "if": "steps.filter.outputs.workflows == 'true'"
"run": "make load"
- "env":
"DIFF": "true"
"GEN_COMMIT": "${{ github.ref == 'refs/heads/master' && github.repository == 'jsonnet-libs/k8s' }}"
"GIT_COMMITTER_EMAIL": "86770550+jsonnet-libs-bot@users.noreply.github.com"
"GIT_COMMITTER_NAME": "jsonnet-libs-bot"
"SSH_KEY": "${{ secrets.DEPLOY_KEY }}"
"if": "steps.filter.outputs.workflows == 'true'"
"run": "make libs/tinkerbell"
"traefik":
"name": "Generate traefik Jsonnet library and docs"
"needs":
Expand Down
27 changes: 27 additions & 0 deletions libs/tinkerbell/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
TMP:=$(shell mktemp -d)

all: update-version crds.libsonnet

.PHONY: update-version
update-version:
@NEW_VERSION=$$(gh release view --repo tinkerbell/tinkerbell --json tagName --jq '.tagName'); \
if [ ! -f version ] || [ "$$(cat version)" != "$$NEW_VERSION" ]; then \
echo "$$NEW_VERSION" > version; \
echo "Updated version to $$NEW_VERSION"; \
else \
echo "Version unchanged: $$NEW_VERSION"; \
fi

crds.libsonnet: version
cd $(TMP) && \
git clone --depth 1 --branch $(shell cat version) --filter=blob:none --sparse https://github.com/tinkerbell/tinkerbell.git && \
cd tinkerbell && \
git sparse-checkout set crd/bases && \
echo '[' > $(ROOT_DIR)/crds.libsonnet && \
cd crd/bases && \
find . -type f -name '*.yaml' | sed 's|^\./||' | sort | xargs -I {} echo "'{}'," >> $(ROOT_DIR)/crds.libsonnet && \
echo ']' >> $(ROOT_DIR)/crds.libsonnet && \
jsonnetfmt -i $(ROOT_DIR)/crds.libsonnet && \
rm -rf $(TMP) || \
rm -rf $(TMP)
20 changes: 20 additions & 0 deletions libs/tinkerbell/config.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
local config = import 'jsonnet/config.jsonnet';

// Run `make` to get the latest version and regenerate `crds.libsonnet`
local version = std.stripChars(importstr './version', ' \n');
local crds = import './crds.libsonnet';

// Major.minor of the upstream tag (e.g. v0.23.0 -> 0.23) used as the output dir.
local output = std.join('.', std.split(std.lstripChars(version, 'v'), '.')[0:2]);

config.new(
name='tinkerbell',
specs=[
{
output: output,
prefix: '^org\\.tinkerbell\\..*',
crds: ['https://raw.githubusercontent.com/tinkerbell/tinkerbell/%s/crd/bases/%s' % [version, crd] for crd in crds],
localName: 'tinkerbell',
},
],
)
9 changes: 9 additions & 0 deletions libs/tinkerbell/crds.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
'bmc.tinkerbell.org_jobs.yaml',
'bmc.tinkerbell.org_machines.yaml',
'bmc.tinkerbell.org_tasks.yaml',
'tinkerbell.org_hardware.yaml',
'tinkerbell.org_templates.yaml',
'tinkerbell.org_workflowrulesets.yaml',
'tinkerbell.org_workflows.yaml',
]
1 change: 1 addition & 0 deletions libs/tinkerbell/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.23.0
Loading