Skip to content
Snippets Groups Projects

add fancy smancy deploy memes

Merged Torma Kristóf requested to merge tormakris-master-patch-12236 into master
Files
3
+ 18
0
@@ -4,6 +4,7 @@ variables:
stages:
- Pre Build
- Docker Build
- deploy
PreBuild:
stage: Pre Build
@@ -33,3 +34,20 @@ Docker build:
script:
- echo "{\"auths\":{\"registry.kszk.bme.hu\":{\"username\":\"$REGISTRY_USER\",\"password\":\"$REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CONTAINER_IMAGE
Deploy to Kubernetes:
stage: deploy
image: alpine
environment:
name: master
script:
- apk add --no-cache curl
- curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
- chmod +x ./kubectl
- mv ./kubectl /usr/local/bin/kubectl
- kubectl version
- cd k8s
- sed -i "s|##IMAGETAG##|${CI_COMMIT_REF_NAME}|" deployment.yaml
- kubectl apply -f deployment.yaml
only:
- tags
Loading