Skip to content

Instantly share code, notes, and snippets.

@vrutkovs
Last active July 23, 2021 18:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vrutkovs/6d96a50643ab4671006a564af2dbb1d4 to your computer and use it in GitHub Desktop.
Save vrutkovs/6d96a50643ab4671006a564af2dbb1d4 to your computer and use it in GitHub Desktop.
stages:
- build
- push
- cleanup
build:
stage: build
variables:
REGISTRY_SERVER: foo.bar
IMAGE_NAME: vrutkovs-public/openshift-ansible-testing
script:
- buildah bud -t ${IMAGE_NAME}:${CI_COMMIT_SHA} .
push:
stage: push
script:
- export TAG=${CI_COMMIT_REF_NAME}
- if [ ${CI_COMMIT_REF_NAME} == "master" ]; then export TAG="latest"; fi
- podman login --username "${REGISTRY_USERNAME}" --password "${REGISTRY_PASSWORD}" "${REGISTRY_SERVER}" --tls-verify=false
- podman push localhost/${IMAGE_NAME}:${CI_COMMIT_SHA} docker://${REGISTRY_SERVER}/${IMAGE_NAME}:${TAG} --tls-verify=false
only:
- branches@vrutkovs/openshift-ansible-testing
cleanup:
stage: cleanup
script:
- buildah rmi ${IMAGE_NAME}:${CI_COMMIT_SHA}
- buildah rmi -p
when: always
concurrent = 1
check_interval = 0
[[runners]]
name = "vrutkovs"
url = "foo"
token = "token"
executor = "docker"
[runners.cache]
[runners.docker]
tls_verify = false
privileged = true
disable_cache = true
image = "tomkukral/buildah:latest"
environment = ["GIT_SSL_NO_VERIFY=true"]
volumes = ["/var/lib/containers/:/var/lib/containers/"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment