Skip to content
Snippets Groups Projects
Verified Commit 9b094b21 authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

Add gitlab CI template

Using templates provides an easy way to integrate the build into more
pipelines without worrying about updates too much.
parent 2ac25286
No related branches found
No related tags found
No related merge requests found
Pipeline #2331 failed
image: quay.io/sheogorath/build-ah-engine include:
local: /gitlab-ci-template.yml
stages:
- analyse
- build
- test
- tag
- deploy
before_script:
- podman login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
variables: variables:
BAE_VERSION: "1.0.0" CONTAINER_VERSION: "1.0.0"
SI_TOOLS_VERSION: "0.2.0" CI_REGISTRY_BUILD_ARG: "--build-arg 0.2.0"
build:
stage: build
script:
- podman build --pull --build-arg SI_TOOLS_VERSION -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
- podman push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
tagging-master: container-tagging:
stage: tag
script:
- podman pull "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
- si-tagging -l "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" "$CI_REGISTRY_IMAGE" "${BAE_VERSION}"
- si-push "$CI_REGISTRY_IMAGE"
only: only:
- master - master
stages:
- build
- tag
variables:
CI_REGISTRY_BUILD_ARGS: ""
container-build:
stage: build
inherit:
default: false
variables:
- CI_REGISTRY
- CI_REGISTRY_USER
- CI_REGISTRY_PASSWORD
- CI_REGISTRY_IMAGE
- CI_REGISTRY_BUILD_ARGS
image: quay.io/sheogorath/build-ah-engine:1.0.0
before_script:
- podman login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- podman build --pull $CI_REGISTRY_BUILD_ARGS -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA" .
- podman push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA"
container-tagging:
stage: tag
inherit:
default: false
variables:
- CI_REGISTRY
- CI_REGISTRY_USER
- CI_REGISTRY_PASSWORD
- CI_REGISTRY_IMAGE
- CI_REGISTRY_IMAGE_VERSION
image: quay.io/sheogorath/build-ah-engine:1.0.0
before_script:
- podman login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- podman pull "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA"
- si-tagging -l "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" "$CI_REGISTRY_IMAGE" "${CI_REGISTRY_IMAGE_VERSION}"
- si-push "$CI_REGISTRY_IMAGE"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment