Add support for building the site via nix.

This commit is contained in:
Tom Alexander
2026-07-11 18:32:38 -04:00
parent feb4b2c082
commit 49966f46fd
10 changed files with 401 additions and 108 deletions

View File

@@ -2,6 +2,8 @@ apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: build-homepage-staging
labels:
pdb: protect
spec:
timeouts:
pipeline: "2h0m0s"
@@ -44,6 +46,51 @@ spec:
#!/usr/bin/env sh
set -euo pipefail
echo -n "$(date +%s)" | tee $(results.unix-time.path)
- name: report-pending
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: f914437a46978b95f325f68d791dcf1a35738f60
- name: pathInRepo
value: task/gitea-set-status/0.1/gitea-set-status.yaml
params:
- name: CONTEXT
value: "$(params.JOB_NAME)"
- name: REPO_FULL_NAME
value: "$(params.REPO_OWNER)/$(params.REPO_NAME)"
- name: GITEA_HOST_URL
value: code.fizz.buzz
- name: SHA
value: "$(tasks.fetch-repository.results.commit)"
- name: DESCRIPTION
value: "Build $(params.JOB_NAME) has started"
- name: STATE
value: pending
- name: TARGET_URL
value: "https://tekton.fizz.buzz/#/namespaces/$(context.pipelineRun.namespace)/pipelineruns/$(context.pipelineRun.name)"
- name: fetch-repository
params:
- name: url
value: $(params.REPO_URL)
- name: revision
value: $(params.PULL_BASE_SHA)
- name: deleteExisting
value: "true"
taskRef:
params:
- name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision
value: "dda7b690195b43e8b9859d1caf5dcbf48588ade1"
- name: pathInRepo
value: task/git-clone/0.1/git-clone.yaml
resolver: git
workspaces:
- name: output
workspace: git-source
- name: get-git-commit-time
taskSpec:
metadata: {}
@@ -69,53 +116,6 @@ spec:
workspace: git-source
runAfter:
- fetch-repository
- name: report-pending
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: f914437a46978b95f325f68d791dcf1a35738f60
- name: pathInRepo
value: task/gitea-set-status/0.1/gitea-set-status.yaml
runAfter:
- fetch-repository
params:
- name: CONTEXT
value: "$(params.JOB_NAME)"
- name: REPO_FULL_NAME
value: "$(params.REPO_OWNER)/$(params.REPO_NAME)"
- name: GITEA_HOST_URL
value: code.fizz.buzz
- name: SHA
value: "$(tasks.fetch-repository.results.commit)"
- name: DESCRIPTION
value: "Build $(params.JOB_NAME) has started"
- name: STATE
value: pending
- name: TARGET_URL
value: "https://tekton.fizz.buzz/#/namespaces/$(context.pipelineRun.namespace)/pipelineruns/$(context.pipelineRun.name)"
- name: fetch-repository
taskRef:
resolver: git
params:
- name: url
value: https://code.fizz.buzz/mirror/catalog.git # mirror of https://github.com/tektoncd/catalog.git
- name: revision
value: f914437a46978b95f325f68d791dcf1a35738f60
- name: pathInRepo
value: task/git-clone/0.9/git-clone.yaml
workspaces:
- name: output
workspace: git-source
params:
- name: url
value: $(params.REPO_URL)
- name: revision
value: $(params.PULL_BASE_SHA)
- name: deleteExisting
value: "true"
- name: build-image
taskRef:
resolver: git
@@ -123,7 +123,7 @@ spec:
- name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision
value: af22c87d0db59dece97d03e6b6a796d84010158f
value: dda7b690195b43e8b9859d1caf5dcbf48588ade1
- name: pathInRepo
value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml
params:
@@ -144,6 +144,8 @@ spec:
- "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true"
- --opt
- build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time)
- --opt
- "build-arg:NIX_SUBSTITUTERS=http://ncps.nix-pull-through-cache.svc.cluster.local:80 https://cache.nixos.org"
- name: BUILDKITD_TOML
value: |
debug = true

View File

@@ -2,6 +2,8 @@ apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: build-homepage
labels:
pdb: protect
spec:
timeouts:
pipeline: "2h0m0s"
@@ -135,7 +137,7 @@ spec:
- name: url
value: https://code.fizz.buzz/talexander/personal_tekton_catalog.git
- name: revision
value: af22c87d0db59dece97d03e6b6a796d84010158f
value: dda7b690195b43e8b9859d1caf5dcbf48588ade1
- name: pathInRepo
value: task/buildkit-rootless-daemonless/0.1/buildkit-rootless-daemonless.yaml
params:
@@ -156,6 +158,8 @@ spec:
- "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true"
- --opt
- build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time)
- --opt
- "build-arg:NIX_SUBSTITUTERS=http://ncps.nix-pull-through-cache.svc.cluster.local:80 https://cache.nixos.org"
- name: BUILDKITD_TOML
value: |
debug = true

View File

@@ -2,6 +2,8 @@ apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: semver
labels:
pdb: protect
spec:
timeouts:
pipeline: "2h0m0s"