buildah
This commit is contained in:
parent
88f3bb9800
commit
fa45bf65b8
@ -6,38 +6,32 @@ stages:
|
||||
before_script:
|
||||
- if [ -n "$KUBE_CONTEXT" ]; then kubectl config use-context "$KUBE_CONTEXT"; fi
|
||||
|
||||
default:
|
||||
image: docker:24.0.5
|
||||
services:
|
||||
- docker:24.0.5-dind
|
||||
before_script:
|
||||
- docker info
|
||||
|
||||
variables:
|
||||
DOCKER_HOST: tcp://docker:2376
|
||||
DOCKER_TLS_CERTDIR: "/certs"
|
||||
DOCKER_TLS_VERIFY: 1
|
||||
DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client"
|
||||
|
||||
docker_build:
|
||||
build:
|
||||
stage: build
|
||||
image: quay.io/buildah/stable
|
||||
variables:
|
||||
STORAGE_DRIVER: vfs
|
||||
BUILDAH_FORMAT: docker
|
||||
FQ_IMAGE_NAME: "$REGISTRY/$REGISTRY_USER/$CI_PROJECT_NAME"
|
||||
before_script:
|
||||
- echo "$REGISTRY_PASSWORD" | buildah login -u "$REGISTRY_USER" --password-stdin $REGISTRY
|
||||
script:
|
||||
- docker build -t registry.yaemiku.dev/yaemiku/hamburger -t registry.yaemiku.dev/yaemiku/hamburger:$CI_COMMIT_TAG .
|
||||
- docker login -u yaemiku -p $DOCKER_PASSWORD registry.yaemiku.dev
|
||||
- docker push -a registry.yaemiku.dev/yaemiku/hamburger
|
||||
- buildah images
|
||||
- buildah build -t $FQ_IMAGE_NAME -t $FQ_IMAGE_NAME:$CI_COMMIT_TAG
|
||||
- buildah images
|
||||
- buildah push -a $FQ_IMAGE_NAME
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
|
||||
deploy:
|
||||
stage: deploy
|
||||
extends: [.kube-context]
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
- if: $CI_COMMIT_TAG
|
||||
image:
|
||||
name: bitnami/kubectl:latest
|
||||
entrypoint: [""]
|
||||
script:
|
||||
- ls
|
||||
- kubectl apply -f $CI_PROJECT_DIR/hamburger.yaml
|
||||
- kubectl get pods -n
|
||||
- kubectl get pods
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
|
Loading…
Reference in New Issue
Block a user