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š 0fa4f3db93
ci: move cache directive to global scope
Signed-off-by: Vojtěch Mareš <vojtech@mares.cz>
2025-06-13 19:51:27 +02:00

44 lines
847 B
YAML

image:
name: hashicorp/packer:light
entrypoint: [""]
variables:
PACKER_LOG: 1 # enable detailed logging
PACKER_VAR_FILE: "vars.pkrvars.hcl"
PACKER_CONFIG_DIR: $CI_PROJECT_DIR
cache:
key: "packer-plugins" # Define a key for Packer plugins
paths:
- "$PACKER_CONFIG_DIR/.packer.d"
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.pkr.hcl
script:
- |
packer build \
$PACKER_FILE
rules:
- if: $CI_COMMIT_BRANCH == "main"