.gitlab-ci.yml file not executing

Hi Team,

I was trying to execute a packer script using gitlab ci/cd file. But not getting executed through it. While trying to execute packer file inside the gitlab runner manually, then it works fine and image gets built.

Please find the logs I’m getting.

image

.gtlab-ci.yml file:

stages:

  • Validate
  • Build

Variables to be defined

variables:
image_def: aws_linux_image_packer.json

Validation stage basically validates the syntax

Validation:
stage: Validate
script:

  • echo “************ Start Validating *************”
  • packer --version
  • packer validate

Build stage will start creating image and deploy it

Build:
stage: Build
dependencies:

  • Validation
    script:
  • echo “************ Start Creating Image ************”
  • packer build -force $image_def