dind
This commit is contained in:
parent
6bf92b2241
commit
88f3bb9800
@ -6,18 +6,25 @@ 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
|
||||||
|
|
||||||
build:
|
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:
|
||||||
stage: build
|
stage: build
|
||||||
image:
|
|
||||||
name: gcr.io/kaniko-project/executor:v1.14.0-debug
|
|
||||||
entrypoint: [""]
|
|
||||||
script:
|
script:
|
||||||
- mkdir -p /kaniko/.docker
|
- docker build -t registry.yaemiku.dev/yaemiku/hamburger -t registry.yaemiku.dev/yaemiku/hamburger:$CI_COMMIT_TAG .
|
||||||
- echo "{\"auths\":{\"registry.yaemiku.dev\":{\"auth\":\"$DOCKER_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
- docker login -u yaemiku -p $DOCKER_PASSWORD registry.yaemiku.dev
|
||||||
- /kaniko/executor
|
- docker push -a registry.yaemiku.dev/yaemiku/hamburger
|
||||||
--context "${CI_PROJECT_DIR}"
|
|
||||||
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
|
|
||||||
--destination "registry.yaemiku.dev/yaemiku/hamburger:${CI_COMMIT_TAG}"
|
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
|
|
||||||
@ -26,12 +33,11 @@ deploy:
|
|||||||
extends: [.kube-context]
|
extends: [.kube-context]
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
- 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
|
- kubectl get pods -n
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_TAG
|
|
||||||
|
@ -14,7 +14,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: hamburger
|
- name: hamburger
|
||||||
image: registry.yaemiku.dev/yaemiku/hamburger
|
image: registry.yaemiku.dev/yaemiku/hamburger:latest
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 3000
|
- containerPort: 3000
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
|
Loading…
Reference in New Issue
Block a user