Compare commits

..

2 Commits

Author SHA1 Message Date
Tom Alexander
71b17b4784 test disable tls.
Some checks failed
build-staging Build build-staging has failed
2026-07-12 17:28:59 -04:00
Tom Alexander
0994de6055 Add support for building the site via nix.
Some checks failed
build-staging Build build-staging has failed
2026-07-12 17:26:23 -04:00
2 changed files with 6 additions and 20 deletions

View File

@@ -108,13 +108,10 @@ spec:
script: |
#!/usr/bin/env sh
set -euo pipefail
find /
echo -n "$(git log -1 --pretty=%ct)" | tee $(results.unix-time.path)
workspaces:
- name: repo
workspace: git-source
- name: nix-cache-creds
workspace: nix-cache-creds
runAfter:
- fetch-repository
- name: build-image
@@ -145,9 +142,6 @@ 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)
# - --secret
# - id=cache_token,src=./my_local_token.txt
# - id=cache_token,env=MY_ENV_TOKEN
- name: BUILDKITD_TOML
value: |
debug = true
@@ -161,8 +155,6 @@ spec:
workspace: git-source
- name: dockerconfig
workspace: docker-credentials
- name: nix-cache-creds
workspace: nix-cache-creds
runAfter:
- fetch-repository
finally:
@@ -227,7 +219,6 @@ spec:
workspaces:
- name: git-source
- name: docker-credentials
- name: nix-cache-creds
workspaces:
- name: git-source
volumeClaimTemplate:
@@ -242,9 +233,6 @@ spec:
- name: docker-credentials
secret:
secretName: harbor-plain
- name: nix-cache-creds
secret:
secretName: nix-pull-through-cache
params:
- name: image-name
value: "harbor.fizz.buzz/private/homepage-staging"

View File

@@ -4,18 +4,16 @@
FROM nixos/nix:2.31.3 AS builder
RUN tee -a /etc/nix/nix.conf <<EOF
extra-experimental-features = nix-command flakes
filter-syscalls = false
substituters = http://ncps.nix-pull-through-cache.svc.cluster.local:80 https://cache.nixos.org
EOF
RUN --mount=type=secret,id=cache_token NIX_CONFIG="extra-access-tokens = ncps.nix-pull-through-cache.svc.cluster.local=$(cat /run/secrets/cache_token)" cp "$(nix build nixpkgs#cacert --print-out-paths)/etc/ssl/certs/ca-bundle.crt" /tmp/ca-bundle.crt
#RUN cp "$(nix --extra-experimental-features "nix-command flakes" --option filter-syscalls false --option substituters "http://ncps.nix-pull-through-cache.svc.cluster.local:80 https://cache.nixos.org" build nixpkgs#cacert --print-out-paths)/etc/ssl/certs/ca-bundle.crt" /tmp/ca-bundle.crt
COPY . /tmp/build
WORKDIR /tmp/build
RUN --mount=type=secret,id=cache_token NIX_CONFIG="extra-access-tokens = ncps.nix-pull-through-cache.svc.cluster.local=$(cat /run/secrets/cache_token)" nix build '.#docker_env'
RUN nix \
--extra-experimental-features "nix-command flakes" \
--option filter-syscalls false \
--option substituters "http://ncps.nix-pull-through-cache.svc.cluster.local:80 https://cache.nixos.org" \
build '.#docker_env'
# Export the built closure to a folder
RUN mkdir /tmp/nix-store-closure