Add CI/CD
This commit is contained in:
parent
9489390299
commit
1426ee409c
26
.gitlab-ci.yml
Normal file
26
.gitlab-ci.yml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
stages:
|
||||||
|
- Docker Build
|
||||||
|
- Deploy
|
||||||
|
|
||||||
|
variables:
|
||||||
|
DOCKER_CONTEXT: .
|
||||||
|
DOCKER_DOCKERFILE: docker/prod-host/Dockerfile
|
||||||
|
DOCKER_NAME: daniel-website
|
||||||
|
|
||||||
|
include:
|
||||||
|
- project: 'DevOps/ci-templates'
|
||||||
|
file: '/docker.gitlab-ci.yml'
|
||||||
|
|
||||||
|
"Deploy to Production":
|
||||||
|
image:
|
||||||
|
name: bitnami/kubectl:1.23
|
||||||
|
entrypoint: [""]
|
||||||
|
stage: "Deploy"
|
||||||
|
when: manual
|
||||||
|
allow_failure: true
|
||||||
|
dependencies:
|
||||||
|
- "Publish Docker Image"
|
||||||
|
script:
|
||||||
|
- 'kubectl --kubeconfig=$K8S_CONFIG -n $K8S_NAMESPACE set image $K8S_DEPLOYMENT_TARGET $K8S_DEPLOYMENT_CONTAINER=$DOCKER_REPOSITORY/$DOCKER_NAME:$CI_COMMIT_SHA'
|
||||||
|
rules:
|
||||||
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $K8S_CONFIG != null && $K8S_NAMESPACE != null && $K8S_DEPLOYMENT_TARGET != null && $K8S_DEPLOYMENT_CONTAINER != null && $DOCKER_REPOSITORY != null && $DOCKER_NAME != null'
|
||||||
Loading…
Reference in New Issue
Block a user