When a parent project kicks off pipeline in job:
testapss-use1 cluster:
trigger:
project: gitops/infra/eks-clusters/testapss-use1
strategy: depend
testqa-use1 cluster:
trigger:
project: gitops/infra/eks-clusters/testqa-use1
strategy: depend
Which includes a project:
include:
project: gitops/infra/eks
file: pipeline.yml
that pipeline.yml
contains:
include:
- template: Terraform.latest.gitlab-ci.yml
stages:
- test
- validate
- build
- deploy
- cleanup
variables:
TF_IN_AUTOMATION: "true"
destroy:
extends: [.terraform:destroy]
needs: []
rules:
- when: manual
The build job doesn’t create a plan.cache or plan.json:
$ gitlab-terraform plan-json
Saving cache for successful job
00:00
Creating cache -protected...
WARNING: processPath: artifact path is not a subpath of project directory: /.terraform/
Archive is up to date!
Created cache
Uploading artifacts for successful job
00:01
Uploading artifacts...
WARNING: processPath: artifact path is not a subpath of project directory: /plan.cache
ERROR: No files to upload
Uploading artifacts...
WARNING: processPath: artifact path is not a subpath of project directory: /plan.json
ERROR: No files to upload
Cleaning up project directory and file based variables
00:00
Job succeeded
So the deploy job on that triggered pipeline fails:
Terraform has been successfully initialized!
╷
│ Error: Failed to load "plan.cache" as a plan file
│
│ Error: stat plan.cache: no such file or directory
╵
Cleaning up project directory and file based variables