ci: Test a configure stage
This commit is contained in:
parent
b957af3edb
commit
429c70d383
2 changed files with 39 additions and 2 deletions
14
.devcontainer/devcontainer.json
Normal file
14
.devcontainer/devcontainer.json
Normal file
|
|
@ -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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,13 +1,38 @@
|
||||||
stages:
|
stages:
|
||||||
|
- configure
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
- package
|
- package
|
||||||
|
|
||||||
|
# Set variables used for builds in CI, should probably set this in the build container if possible
|
||||||
variables:
|
variables:
|
||||||
|
AF_PATH: /usr/local
|
||||||
# Use Docker-outside-of-Docker (DooD) by mounting the host's Docker socket
|
# Use Docker-outside-of-Docker (DooD) by mounting the host's Docker socket
|
||||||
DOCKER_HOST: unix:///var/run/docker.sock
|
DOCKER_HOST: unix:///var/run/docker.sock
|
||||||
# Disable TLS as we're using the local socket
|
# Disable TLS as we're using the local socket
|
||||||
DOCKER_TLS_CERTDIR: ""
|
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 the Rust application using Nix
|
||||||
build:
|
build:
|
||||||
|
|
@ -54,8 +79,6 @@ test:
|
||||||
build-docker-image:
|
build-docker-image:
|
||||||
stage: package
|
stage: package
|
||||||
image: nixos/nix:latest
|
image: nixos/nix:latest
|
||||||
services:
|
|
||||||
# No docker:dind service - we'll use the host's Docker daemon
|
|
||||||
before_script:
|
before_script:
|
||||||
# Install Docker CLI in the Nix container
|
# Install Docker CLI in the Nix container
|
||||||
- nix-env -iA nixpkgs.docker
|
- nix-env -iA nixpkgs.docker
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue