Compare commits
2 Commits
affd4e61d6
...
71b17b4784
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71b17b4784
|
||
|
|
0994de6055
|
@@ -108,13 +108,10 @@ spec:
|
|||||||
script: |
|
script: |
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
find /
|
|
||||||
echo -n "$(git log -1 --pretty=%ct)" | tee $(results.unix-time.path)
|
echo -n "$(git log -1 --pretty=%ct)" | tee $(results.unix-time.path)
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: repo
|
- name: repo
|
||||||
workspace: git-source
|
workspace: git-source
|
||||||
- name: nix-cache-creds
|
|
||||||
workspace: nix-cache-creds
|
|
||||||
runAfter:
|
runAfter:
|
||||||
- fetch-repository
|
- fetch-repository
|
||||||
- name: build-image
|
- 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"
|
- "type=registry,ref=$(params.image-name):buildcache,mode=max,compression=zstd,compression-level=22,rewrite-timestamp=true,image-manifest=true,oci-mediatypes=true"
|
||||||
- --opt
|
- --opt
|
||||||
- build-arg:SOURCE_DATE_EPOCH=$(tasks.get-git-commit-time.results.unix-time)
|
- 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
|
- name: BUILDKITD_TOML
|
||||||
value: |
|
value: |
|
||||||
debug = true
|
debug = true
|
||||||
@@ -161,8 +155,6 @@ spec:
|
|||||||
workspace: git-source
|
workspace: git-source
|
||||||
- name: dockerconfig
|
- name: dockerconfig
|
||||||
workspace: docker-credentials
|
workspace: docker-credentials
|
||||||
- name: nix-cache-creds
|
|
||||||
workspace: nix-cache-creds
|
|
||||||
runAfter:
|
runAfter:
|
||||||
- fetch-repository
|
- fetch-repository
|
||||||
finally:
|
finally:
|
||||||
@@ -227,7 +219,6 @@ spec:
|
|||||||
workspaces:
|
workspaces:
|
||||||
- name: git-source
|
- name: git-source
|
||||||
- name: docker-credentials
|
- name: docker-credentials
|
||||||
- name: nix-cache-creds
|
|
||||||
workspaces:
|
workspaces:
|
||||||
- name: git-source
|
- name: git-source
|
||||||
volumeClaimTemplate:
|
volumeClaimTemplate:
|
||||||
@@ -242,9 +233,6 @@ spec:
|
|||||||
- name: docker-credentials
|
- name: docker-credentials
|
||||||
secret:
|
secret:
|
||||||
secretName: harbor-plain
|
secretName: harbor-plain
|
||||||
- name: nix-cache-creds
|
|
||||||
secret:
|
|
||||||
secretName: nix-pull-through-cache
|
|
||||||
params:
|
params:
|
||||||
- name: image-name
|
- name: image-name
|
||||||
value: "harbor.fizz.buzz/private/homepage-staging"
|
value: "harbor.fizz.buzz/private/homepage-staging"
|
||||||
|
|||||||
@@ -4,18 +4,16 @@
|
|||||||
|
|
||||||
FROM nixos/nix:2.31.3 AS builder
|
FROM nixos/nix:2.31.3 AS builder
|
||||||
|
|
||||||
RUN tee -a /etc/nix/nix.conf <<EOF
|
#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
|
||||||
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
|
|
||||||
|
|
||||||
COPY . /tmp/build
|
COPY . /tmp/build
|
||||||
WORKDIR /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
|
# Export the built closure to a folder
|
||||||
RUN mkdir /tmp/nix-store-closure
|
RUN mkdir /tmp/nix-store-closure
|
||||||
|
|||||||
Reference in New Issue
Block a user