Files
vms/.gitlab-ci.yml
T
Greg Hellings 810008b1ea Skip restore step
With the new cache setup, there is no need for me to run the cache
restore before doing a download. However, it is now once again necessary
that download begin AFTER the dynamic scripts have already executed
their bits
2024-06-26 21:56:19 -05:00

83 lines
1.4 KiB
YAML

stages:
- generate
- check
- trigger
variables:
PACKER_CONFIG_DIR: ./packer_config/
PACKER_CACHE_DIR: ./cache/
default:
image: registry.thehellings.com/greg/ci-images/vm-test:latest
generate:
stage: generate
artifacts:
paths:
- distros/**/*.pkrvars.hcl
script: |-
for vars in $(find distros/ -name '*.pkrvars.hcl.sh'); do
bash "./${vars}"
done
continue:
stage: generate
artifacts:
reports:
dotenv: build.env
paths:
- .gitlab-ci-build.yml
tags:
- nix
script:
- nix build ".#continue"
- cp result .gitlab-ci-build.yml
- cat result
shellcheck:
stage: generate
tags:
- nix
script: nix run ".#shellcheck"
validate:
stage: check
tags:
- nix
needs:
- generate
cache:
- key:
files:
- sources/build.pkr.hcl
paths:
- ./packer_config/
script: nix run ".#validate"
# Makes sure that all of the ISO files we are looking for are
# present on the S3 buckets that we use
downloads:
stage: check
retry: 2
tags:
- nix
needs:
- generate
cache:
- key:
files:
- sources/build.pkr.hcl
paths:
- ./packer_config/
script:
- nix run ".#cache"
trigger:
stage: trigger
trigger:
include:
- artifact: .gitlab-ci-build.yml
job: continue
variables:
PARENT_PIPELINE_ID: $CI_PIPELINE_ID