Commit e855aebe authored by Simon Volpert's avatar Simon Volpert 🐧
Browse files

build dir var

parents 7cc5f34f d672e6bd
# ci-templates
# CI Templates
This is a collection of includable pipeline jobs to use in any project.
[[_TOC_]]
## Usage Example
To use within your repository add the following to your `.gitlab-ci.yaml` to enable cross architecture builds
......@@ -38,3 +44,26 @@ include:
In this case, the `img-cross` template defined the `containerize` job which is extended by the stage definition.
For further information refert to https://docs.gitlab.com/ee/ci/yaml/#include
## Jobs and config
### img.yml
Builds a container image on Kubernetes using the `img` tool
**Jobs**: `containerize`,
| Configuration Option | Default | Description |
| -------------------- | ------- | ------------------------------- |
| `IMG_BUILD_DIR` | `.` | Set the build directory to path |
### img-cross.yml
Builds a multi-arch container image on Kubernetes using the `img` tool
**Jobs**: `containerize`,
| Configuration Option | Default | Description |
| -------------------- | ------- | ------------------------------- |
| `IMG_BUILD_DIR` | `.` | Set the build directory to path |
variables:
IMG_BUILD_DIR: .
containerize:
tags:
- kubernetes
......@@ -6,7 +9,7 @@ containerize:
entrypoint: [""]
script:
- img login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- img build --platform linux/amd64,linux/arm64,linux/arm/v7 -t "$CI_REGISTRY_IMAGE" .
- img build --platform linux/amd64,linux/arm64,linux/arm/v7 -t "$CI_REGISTRY_IMAGE" $IMG_BUILD_DIR
- img tag "$CI_REGISTRY_IMAGE" "$CI_REGISTRY_IMAGE":"$CI_COMMIT_REF_NAME"
- img push "$CI_REGISTRY_IMAGE"
- img push "$CI_REGISTRY_IMAGE":"$CI_COMMIT_REF_NAME"
variables:
IMG_BUILD_DIR: .
containerize:
tags:
- kubernetes
......@@ -6,7 +9,7 @@ containerize:
entrypoint: [""]
script:
- img login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- img build -t "$CI_REGISTRY_IMAGE" .
- img build -t "$CI_REGISTRY_IMAGE" $IMG_BUILD_DIR
- img tag "$CI_REGISTRY_IMAGE" "$CI_REGISTRY_IMAGE":"$CI_COMMIT_REF_NAME"
- img push "$CI_REGISTRY_IMAGE"
- img push "$CI_REGISTRY_IMAGE":"$CI_COMMIT_REF_NAME"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment