Change CI to use Podman
This commit is contained in:
parent
3665f8c4f0
commit
8b6a2e0ebf
1 changed files with 21 additions and 14 deletions
|
|
@ -1,7 +1,5 @@
|
||||||
default:
|
default:
|
||||||
image: docker:28.5.1-dind
|
image: quay.io/podman/stable
|
||||||
services:
|
|
||||||
- "docker:28.5.1-dind"
|
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
DOCKER_TLS_CERTDIR: "/certs"
|
DOCKER_TLS_CERTDIR: "/certs"
|
||||||
|
|
@ -9,6 +7,7 @@ variables:
|
||||||
stages:
|
stages:
|
||||||
- test
|
- test
|
||||||
- build-and-push-image
|
- build-and-push-image
|
||||||
|
- push-retagged-branch
|
||||||
- push-retagged-latest
|
- push-retagged-latest
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
|
@ -19,24 +18,32 @@ test:
|
||||||
- git submodule update --init
|
- git submodule update --init
|
||||||
- cargo test
|
- cargo test
|
||||||
|
|
||||||
|
|
||||||
build-and-push-image:
|
build-and-push-image:
|
||||||
stage: build-and-push-image
|
stage: build-and-push-image
|
||||||
script:
|
script:
|
||||||
- git submodule update --init
|
- git submodule update --init
|
||||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||||
- docker build -t "$CI_REGISTRY_IMAGE:$IMAGE_TAG" .
|
- podman build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" .
|
||||||
- docker push "$CI_REGISTRY_IMAGE:$IMAGE_TAG"
|
- podman push "$CI_REGISTRY_IMAGE:$IMAGE_TAG"
|
||||||
|
|
||||||
|
push-retagged-branch:
|
||||||
|
stage: push-retagged-branch
|
||||||
|
script:
|
||||||
|
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||||
|
- podman pull "$CI_REGISTRY_IMAGE:$IMAGE_TAG"
|
||||||
|
- podman tag "$CI_REGISTRY_IMAGE:$IMAGE_TAG" "$CI_REGISTRY_IMAGE:$IMAGE_TAG"
|
||||||
|
- podman push "$CI_REGISTRY_IMAGE:latest"
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_SOURCE == "push"
|
||||||
|
when: on_success
|
||||||
|
|
||||||
push-retagged-latest:
|
push-retagged-latest:
|
||||||
stage: push-retagged-latest
|
stage: push-retagged-latest
|
||||||
script:
|
script:
|
||||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
- podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||||
- docker pull "$CI_REGISTRY_IMAGE:$IMAGE_TAG"
|
- podman pull "$CI_REGISTRY_IMAGE:$IMAGE_TAG"
|
||||||
- docker tag "$CI_REGISTRY_IMAGE:$IMAGE_TAG" "$CI_REGISTRY_IMAGE:latest"
|
- podman tag "$CI_REGISTRY_IMAGE:$IMAGE_TAG" "$CI_REGISTRY_IMAGE:latest"
|
||||||
- docker push "$CI_REGISTRY_IMAGE:latest"
|
- podman push "$CI_REGISTRY_IMAGE:latest"
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||||
when: on_success
|
when: on_success
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue