Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Staff
ci-templates
Commits
d672e6bd
Commit
d672e6bd
authored
Sep 21, 2020
by
Simon Volpert
🐧
Browse files
Merge branch 'img_build_dir' into 'master'
img_build_dir See merge request
!2
parents
efc37db2
b40488e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
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
...
...
@@ -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|
img-cross.yml
View file @
d672e6bd
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"
img.yml
View file @
d672e6bd
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"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment