-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gitlab ci workflow to build docker image
Change-Id: Ibdd497d7645a36534542d2896251393eea36248c
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
!/.gitignore | ||
!/.github | ||
!/.dockerignore | ||
!/.gitlab-ci.yml | ||
target | ||
tmp | ||
logs | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# gitlab ci pipeline to build kustvakt docker container | ||
# automatically triggered on tag pushs or run manually | ||
# | ||
# Download latest container from artifacts and import it: | ||
# | ||
# curl -Ls 'https://gitlab.ids-mannheim.de/KorAP/kustvakt/-/jobs/artifacts/master/raw/kustvakt.tar.xz?job=build-docker' | docker load | ||
|
||
image: docker:latest | ||
|
||
services: | ||
- docker:dind | ||
|
||
build-docker: | ||
rules: | ||
- if: $CI_COMMIT_TAG =~ /.+/ | ||
variables: | ||
VID: $CI_COMMIT_TAG | ||
- when: manual | ||
variables: | ||
VID: $CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA | ||
stage: build | ||
before_script: | ||
- apk update | ||
- apk add --no-cache git | ||
script: | ||
- docker build -f Dockerfile -t korap/kustvakt:$VID -t korap/kustvakt:latest -t korap/kustvakt:$VID-full -t korap/kustvakt:latest-full --target kustvakt-full . | ||
- docker save korap/kustvakt:$VID-full | xz -T0 -M16G -9 > kustvakt.tar.xz | ||
artifacts: | ||
paths: | ||
- kustvakt.tar.xz | ||
|