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
14 changes: 14 additions & 0 deletions ci/docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# NB: Only our CI agents push to this cache but we don't have PKI (e.g.
# signing) setup for them.
## So we mark the cache as trusted to skip signature verifications.
CACHE="s3://redpanda-nix-cache-k8s-m6id12xlarge?region=us-west-2&trusted=true"

nix develop --option extra-substituters "$CACHE" --impure --command "$@"
EXIT_CODE="$?"

echo "--- Pushing to :nix: cache"
nix copy --to "$CACHE" .#devshell

exit "$EXIT_CODE"
4 changes: 3 additions & 1 deletion ci/docker/nix.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ RUN echo 'experimental-features = nix-command flakes' >> /etc/nix/nix.conf \
# easier to disable this check entirely:
&& git config --global --add safe.directory '*'

ENTRYPOINT ["nix", "develop", "--impure", "--command"]
COPY ci/docker/entrypoint.sh /

ENTRYPOINT ["bash", "/entrypoint.sh"]
2 changes: 1 addition & 1 deletion ci/scripts/run-in-nix-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fi
set -e

# BUILDKITE environment variables are used by `buildkite-agent` cli to upload artifact
printenv | grep '^BUILDKITE.*=' > env-file-for-buildkite
printenv | { grep '^BUILDKITE.*=' || true; } > env-file-for-buildkite

# Build the base image and grab the SHA.
IMAGE_SHA=$(docker build --quiet -f ./ci/docker/nix.Dockerfile .)
Expand Down
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
{
formatter = pkgs.nixpkgs-fmt;

# Make it possible to reference the devshell context from standard
# nix commands. e.g. nix copy .#devshell.
packages.devshell = self'.devShells.default;

devshells.default = {
env = [
{ name = "GOROOT"; value = "${pkgs.go_1_24}/share/go"; }
Expand Down
16 changes: 3 additions & 13 deletions taskfiles/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ tasks:
- task: set-aio-max
- task: set-inotify-watches
- task: set-inotify-instances
- task: configure-git-private-repo
- cmd: "mkdir -p {{.SRC_DIR}}/artifacts"
# Fetch the release branches for our git based linters.
- cmd: git fetch origin release/v2.4.x

lint:
cmds:
Expand All @@ -24,6 +21,7 @@ tasks:
test:unit:
cmds:
- defer: 'buildkite-agent artifact upload "{{.SRC_DIR}}/artifacts/*"'
- 'echo "--- Running unit tests"'
- task: :test:unit
vars:
GO_TEST_RUNNER: 'gotestsum --junitfile=artifacts/unit-tests.xml --'
Expand All @@ -33,6 +31,7 @@ tasks:
cmds:
- defer: 'kind delete clusters --all'
- defer: 'buildkite-agent artifact upload "{{.SRC_DIR}}/artifacts/*"'
- 'echo "--- Running integration tests"'
- task: :test:integration
vars:
GO_TEST_RUNNER: 'gotestsum --junitfile=artifacts/integration-tests.xml --'
Expand All @@ -42,6 +41,7 @@ tasks:
cmds:
- defer: 'kind delete clusters --all'
- defer: 'buildkite-agent artifact upload "{{.SRC_DIR}}/artifacts/*"'
- 'echo "--- Running acceptance tests"'
- task: :test:acceptance
vars:
GO_TEST_RUNNER: 'gotestsum --junitfile=artifacts/acceptance-tests.xml --'
Expand All @@ -66,16 +66,6 @@ tasks:
vars:
KUTTL_CONFIG_FILE: kuttl-v2-test.yaml

configure-git-private-repo:
internal: true
env:
GITHUB_TOKEN:
sh: echo "${GITHUB_TOKEN:-$GITHUB_API_TOKEN}"
cmds:
- git config --global url."https://[email protected]/".insteadOf "https://github.com/"
preconditions:
- test -n "$GITHUB_API_TOKEN" || test -n "$GITHUB_TOKEN"

run-kuttl-tests:
cmds:
- defer:
Expand Down