init project

This commit is contained in:
aditya.siregar
2024-05-28 14:14:55 +07:00
commit 67f1dbc850
141 changed files with 16879 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
stages:
- build
- staging
build_image:
stage: build
image: docker:19.03.12
services:
- docker:19.03.12-dind
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
only:
- main
deploy_to_staging:
stage: staging
image:
name: bitnami/kubectl
entrypoint: [""]
script:
- echo "$KUBECONFIG_BASE64" | base64 -d > ./kubeconfig
- export KUBECONFIG=$(pwd)/kubeconfig
- sed -i "s/<VERSION>/$CI_COMMIT_SHORT_SHA/" k8s/staging/deployment.yaml
- kubectl apply -f k8s/staging/namespace.yaml
- kubectl apply -f k8s/staging/deployment.yaml
- kubectl apply -f k8s/staging/service.yaml
- kubectl apply -f k8s/staging/ingress.yaml
only:
- main
# tes bintang 4