1
0
Fork 0
This repository has been archived on 2025-08-24. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
mareshq-hcloud-images/.gitlab-ci.yml
Vojtěch Mareš ce8bc62861
ci: add .gitlab-ci.yml to automatically build the images
Signed-off-by: Vojtěch Mareš <vojtech@mares.cz>
2025-06-13 19:35:47 +02:00

38 lines
693 B
YAML

image:
name: hashicorp/packer:light
entrypoint: [""]
variables:
PACKER_LOG: 1 # enable detailed logging
PACKER_VAR_FILE: "vars.pkrvars.hcl"
stages:
- validate
- build
.parallel:
parallel:
matrix:
- IMAGE: [ "flatcar" ]
validate:
extends: .parallel
stage: validate
variables:
PACKER_WORKSPACE: images/$IMAGE
script:
- packer init $PACKER_WORKSPACE
- packer fmt -check $PACKER_WORKSPACE
- packer validate $PACKER_WORKSPACE
build-image:
extends: .parallel
stage: build
variables:
PACKER_FILE: images/$IMAGE/image.hcl
script:
- |
packer build \
$PACKER_FILE
rules:
- if: $CI_COMMIT_BRANCH == "main"