buildah
This commit is contained in:
parent
88f3bb9800
commit
fa45bf65b8
@ -6,38 +6,32 @@ stages:
|
|||||||
before_script:
|
before_script:
|
||||||
- if [ -n "$KUBE_CONTEXT" ]; then kubectl config use-context "$KUBE_CONTEXT"; fi
|
- if [ -n "$KUBE_CONTEXT" ]; then kubectl config use-context "$KUBE_CONTEXT"; fi
|
||||||
|
|
||||||
default:
|
build:
|
||||||
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:
|
|
||||||
stage: 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:
|
script:
|
||||||
- docker build -t registry.yaemiku.dev/yaemiku/hamburger -t registry.yaemiku.dev/yaemiku/hamburger:$CI_COMMIT_TAG .
|
- buildah images
|
||||||
- docker login -u yaemiku -p $DOCKER_PASSWORD registry.yaemiku.dev
|
- buildah build -t $FQ_IMAGE_NAME -t $FQ_IMAGE_NAME:$CI_COMMIT_TAG
|
||||||
- docker push -a registry.yaemiku.dev/yaemiku/hamburger
|
- buildah images
|
||||||
|
- buildah push -a $FQ_IMAGE_NAME
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
extends: [.kube-context]
|
extends: [.kube-context]
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
||||||
- if: $CI_COMMIT_TAG
|
|
||||||
image:
|
image:
|
||||||
name: bitnami/kubectl:latest
|
name: bitnami/kubectl:latest
|
||||||
entrypoint: [""]
|
entrypoint: [""]
|
||||||
script:
|
script:
|
||||||
- ls
|
- ls
|
||||||
- kubectl apply -f $CI_PROJECT_DIR/hamburger.yaml
|
- 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