Created
January 4, 2023 22:11
-
-
Save AndrewFarley/694701ce1399e44e5b6f3e3bbf385d1b to your computer and use it in GitHub Desktop.
Gitlab CI Template example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Include our pre-engineered Gitlab-CI Templates | |
include: | |
# This is our global base and templates, always should be included together | |
- project: 'devops/gitlab-ci-templates' | |
ref: master | |
file: '/base.yml' | |
- project: 'devops/gitlab-ci-templates' | |
ref: master | |
file: '/global-templates.yml' | |
- project: 'devops/gitlab-ci-templates' | |
ref: master | |
file: '/add-other-templates-if-you-need-but-their-order-matters.yml' | |
# This builds our Docker image from a template | |
build-docker: | |
extends: .build-and-publish-via-docker # <-- You create this hidden job in your templates repo | |
variables: | |
DOCKER_ARGS: --build-arg BUILD_FOR_ENVIRONMENT=production | |
# This deploys via a template to Kubernetes | |
deploy: | |
extends: .deploy-to-dev # <-- You create this hidden job in your templates repo |
@tmeijn Neat, I didn't know that, will save us some space! Must be a newer addition or something I overlooked when I first started doing this.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice! FYI
include.file
also supports an array of files so you only could reference the project once.