Streamline the push and build process
This commit is contained in:
+11
-63
@@ -3,6 +3,17 @@ stages:
|
||||
- check
|
||||
- trigger
|
||||
|
||||
include:
|
||||
# Low-effort, we can always do lint checks, validations, and so forth
|
||||
- local: .gitlab/always.yml
|
||||
# Actual download of ISOs and building of images. This should only be
|
||||
# done some of the time
|
||||
- local: .gitlab/build.yml
|
||||
rules:
|
||||
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
||||
- if: $CI_PIPELINE_SOURCE == "tag"
|
||||
- if: $CI_COMMIT_BRANCH == "main"
|
||||
|
||||
variables:
|
||||
PACKER_CONFIG_DIR: ./packer_config/
|
||||
PACKER_CACHE_DIR: ./cache/
|
||||
@@ -11,66 +22,3 @@ default:
|
||||
image: registry.thehellings.com/greg/ci-images/vm-test:latest
|
||||
tags:
|
||||
- nix
|
||||
|
||||
generate:
|
||||
stage: generate
|
||||
artifacts:
|
||||
paths:
|
||||
- distros/**/*.pkrvars.hcl
|
||||
reports:
|
||||
dotenv: build.env
|
||||
script: nix run ".#generate"
|
||||
|
||||
continue:
|
||||
stage: generate
|
||||
artifacts:
|
||||
paths:
|
||||
- .gitlab-ci-build.yml
|
||||
script:
|
||||
- nix build ".#continue"
|
||||
- cp result .gitlab-ci-build.yml
|
||||
- cat result
|
||||
|
||||
shellcheck:
|
||||
stage: generate
|
||||
script: nix run ".#shellcheck"
|
||||
|
||||
flake-check:
|
||||
stage: generate
|
||||
script: nix flake check
|
||||
|
||||
validate:
|
||||
stage: check
|
||||
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
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user