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

img_build_dir

parent efc37db2
# 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
......@@ -6,7 +12,7 @@ To use within your repository add the following
include:
- project: 'staff/ci-templates'
file: '/img-cross.yml'
ref: 1.0.0
ref: 1.1.0
```
Adapt `file:` accordingly
......@@ -23,9 +29,32 @@ containerize:
include:
- project: 'staff/ci-templates'
file: '/img-cross.yml'
ref: 1.0.0
ref: 1.1.0
```
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