Commit 9b7b40df authored by Simon Cornet's avatar Simon Cornet
Browse files

feat: push build to gitlab registry

parent 69e2c7e3
Loading
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

variables:
  STORAGE_DRIVER: "overlay"
  IMAGE_TAG: "ssh-client"

stages:
  - "build"
@@ -11,18 +12,18 @@ build:
  image: "quay.io/buildah/stable:latest"
  script:

    # login
    - "echo $CR_PASSWORD | buildah login -u $CR_USERNAME --password-stdin $CR_HOSTNAME"
    # login to container registry
    - "echo $CI_REGISTRY_PASSWORD | buildah login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY"

    # build image
    - "buildah bud -t ssh-client -f Dockerfile.linux.amd64 ."
    - "buildah bud -t $IMAGE_TAG -f Dockerfile.linux.amd64 ."

    # tag image
    - "buildah tag ssh-client cr.simoncor.net/siempie/ssh-client:latest"
    - "buildah tag ssh-client cr.simoncor.net/siempie/ssh-client:v25.06.03"
    # add tags to image
    - "buildah tag $IMAGE_TAG $CI_REGISTRY_IMAGE:latest"
    - "buildah tag $IMAGE_TAG $CI_REGISTRY_IMAGE:v25.06.03"

    # push image
    - "buildah push cr.simoncor.net/siempie/ssh-client:latest"
    - "buildah push $CI_REGISTRY_IMAGE:latest"

    # logout
    - "buildah logout $CR_HOSTNAME"
    # logout from container registry
    - "buildah logout $CI_REGISTRY"