include remote and include local on the same file are having different results
Hi
While I'm using include on the same .yml file which is present locally vs in a remote repo I see different behaviors.
When I use the local one, everything works fine.
But when I use the remote one I get an error that the yml is invalid.
What am I missing?
Thanks
Here is my gitlab-ci yml:
include: 'gitlab_common.yml'
image: maven:3-jdk-11-slim
variables:
K8S_NAMESPACE: abc
stages:
- build
- quality
- dockerize
- test-deploy
package:
stage: build
script:
- build
artifacts:
paths:
- app/target/
sonar:
stage: quality
except:
- master
- dev
script:
- sonarqube
dependencies:
- package
when: on_success
artifacts:
paths:
- app/target/
dependency_check:
stage: quality
except:
- master
- dev
script:
- dependency_check
dependencies:
- package
when: on_success
artifacts:
paths:
- app/target/
update_check:
stage: quality
except:
- master
- dev
script:
- update_check
dependencies:
- package
when: on_success
artifacts:
paths:
- app/target/
dockerize:
stage: dockerize
image: docker:stable
services:
- docker:dind
script:
- dockerize
dependencies:
- sonar
when: on_success
tags:
- docker
artifacts:
paths:
- app/target/
test-deploy:
stage: test-deploy
image: "gitlab-registry.nordstrom.com/sm/docker-mvn-nonroot:3-jdk-11-slim"
environment:
name: test
variables:
K8S_TOKEN: $K8S_BEARER_TOKEN_NP_1
K8S_CLUSTER: aws-nonprod-cluster-1
KUBECONFIG: /tmp/kubeconfig.yml
script:
- deploy_k8s
- oop_it
dependencies:
- dockerize
when: on_success
And my gitlab_common.yml is: (I've truncated it for brevity)
.gitlab_common: &gitlab_common |
[[ "$TRACE" ]] && set -eu
function build(){
mvn --version
mvn -B package
}
before_script:
- *gitlab_common
When I try to use include: 'https:\\...\gitlab_common.yml' I get the error.
Edited by Jason Yavorsky