From 429c70d383588ed5d4179f883a1d2606ff5a313d Mon Sep 17 00:00:00 2001 From: Matthew Binning Date: Fri, 12 Dec 2025 17:51:35 -0800 Subject: [PATCH] ci: Test a configure stage --- .devcontainer/devcontainer.json | 14 ++++++++++++++ .gitlab-ci.yml | 27 +++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..fd35155 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,14 @@ +{ + "name": "Dood Build", + "image": "gl.whitefoxdefense.com:5050/mbinning/dood/build:0.5", + "customizations": { + "vscode": { + "settings": {}, + "extensions": [ + "vadimcn.vscode-lldb", + "streetsidesoftware.code-spell-checker", + "rust-lang.rust-analyzer" + ] + } + } +} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1ddf5ad..0d00e90 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,38 @@ stages: + - configure - build - test - package +# Set variables used for builds in CI, should probably set this in the build container if possible variables: + AF_PATH: /usr/local # Use Docker-outside-of-Docker (DooD) by mounting the host's Docker socket DOCKER_HOST: unix:///var/run/docker.sock # Disable TLS as we're using the local socket DOCKER_TLS_CERTDIR: "" + DOCKER_AUTH_CONFIG: '{"auths":{"gl.whitefoxdefense.com:5050":{"auth":"Z2l0bGFiK2RlcGxveS10b2tlbi04OmdsZHQtSnNiVFFoeXhpUWNxcHFXMndfYjY="}}}' + LD_LIBRARY_PATH: /usr/local/lib + # Experimental for the EKS runner + # DOCKER_HOST: "tcp://docker:2375" + +# Dynamically pull the build container image name from the devcontainer.json file. +# This acts as a single-source-of-truth to keep local and CI builds unified. +configure: + stage: configure + image: alpine:latest + before_script: + - apk add --no-cache jq + script: + - BUILD_IMAGE=$(jq -r '.image // .build.args.BASE_IMAGE' .devcontainer/devcontainer.json) + - printf 'BUILD_IMAGE=%s' "$BUILD_IMAGE" > build_image.env + - ls -la build_image.env + - cat build_image.env + artifacts: + reports: + dotenv: build_image.env + tags: + - test-ci-cd # Build the Rust application using Nix build: @@ -54,8 +79,6 @@ test: build-docker-image: stage: package image: nixos/nix:latest - services: - # No docker:dind service - we'll use the host's Docker daemon before_script: # Install Docker CLI in the Nix container - nix-env -iA nixpkgs.docker