Verified Commit bfee019c authored by tr's avatar tr
Browse files

Build using buildah

parent 47f6d549
Pipeline #5109 failed with stages
in 1 minute and 4 seconds
---
image:
name: "registry.code.immerda.ch/netlab/apps/base/centos-stream:8"
include:
- project: 'netlab/apps/base'
file: '/gitlab-ci.buildah.yml'
stages:
- build
- test
- deploy
build:
Build Image:
stage: build
tags:
- dind
- buildah
script:
- docker version
- docker build --no-cache -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" .
- docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
- buildah bud --isolation=chroot --format docker -f Dockerfile -t "${CI_PROJECT_NAME,,}:$CI_COMMIT_SHORT_SHA"
- skopeo copy
--authfile ./cred.json
"containers-storage:localhost/${CI_PROJECT_NAME,,}:$CI_COMMIT_SHORT_SHA"
"docker://$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
test:
Test Image:
stage: test
tags:
- docker
- container
image:
name: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
entrypoint: [""]
before_script: []
script:
- echo "Image $CI_REGISTRY_IMAGE $CI_COMMIT_REF_NAME"
- echo "Image $CI_JOB_IMAGE"
- rpm -q mock
- ls -alhrt /etc/mock/epel-*
deploy latest:
Deploy Image:
stage: deploy
tags:
- dind
only:
- master
- container
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
script:
- docker version
- docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
- docker pull "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
- docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" "$CI_REGISTRY_IMAGE:latest"
- docker rmi "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
- docker push "$CI_REGISTRY_IMAGE:latest"
- skopeo copy
--authfile ./cred.json
"docker://$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
"docker://$CI_REGISTRY_IMAGE:latest"
# vim: set ts=2 sw=2 :
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