Skip to content
Snippets Groups Projects
Commit 1f70c5d4 authored by Cedric Verstege's avatar Cedric Verstege
Browse files

Add docker build to CI

parent ee1db51a
Branches
No related tags found
No related merge requests found
Pipeline #3596 failed
stages:
- update
- build
- ⏫ Update
- 🏗️ Build
variables:
DOCKER_IMAGE: cverstege/alma9-base
DOCKER_TAG: latest
before_script:
- apt-get update && apt-get install -y curl git
update_dockerfile:
stage: update
Update Upstream 🛠️:
stage: ⏫ Update
script:
- ./alma9-base/update.sh
- git config user.name "CI Pipeline"
- git config user.email "cedric.verstege@kit.edu"
- git add alma9-base/Dockerfile
- git commit -m "Update upstream to version $(grep -oP "FROM cern/alma9-base:\K[\w.-]+" "alma9-base/Dockerfile")"
- git commit -m "Update upstream to version $(grep -oP "FROM cern/alma9-base:\K[\w.-]+" "alma9-base/Dockerfile")"
- git remote set-url --push origin "https://$CI_COMMITTER_USER_AND_TOKEN@gitlab.etp.kit.edu/cverstege/docker-images.git"
- git push origin HEAD:$CI_COMMIT_REF_NAME
rules:
......@@ -25,3 +24,12 @@ update_dockerfile:
allow_failure: false
- when: manual
allow_failure: true
Build Docker Image:
stage: 🏗️ Build
image:
name: docker:dind
script:
- docker build -t $DOCKER_IMAGE:$(grep -oP "FROM cern/alma9-base:\K[\w.-]+" "alma9-base/Dockerfile") $DOCKER_IMAGE:latest alma9-base
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker push cverstege/alma9-base --all-tags
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment