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š 2a001e388e
ci: fix packer dir for caching
Signed-off-by: Vojtěch Mareš <vojtech@mares.cz>
2025-06-13 19:43:53 +02:00

42 lines
837 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
cache:
key: "packer-plugins" # Define a key for Packer plugins
paths:
- "~/.config/packer" # Or your specific plugin path
build-image:
extends: .parallel
stage: build
variables:
PACKER_FILE: images/$IMAGE/image.pkr.hcl
script:
- |
packer build \
$PACKER_FILE
rules:
- if: $CI_COMMIT_BRANCH == "main"