Skip to content
Snippets Groups Projects
Verified Commit ec5a301b authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

Add staging

parent e9be5471
Branches
No related tags found
No related merge requests found
Pipeline #17209 canceled
stages:
- build
- container
- deploy
variables:
CI_REGISTRY_IMAGE: ${CI_REGISTRY}/${CI_PROJECT_NAME}
KUBECONFIG_VAR_NAME: KUBECONFIG
build:
image: node:17-alpine3.14
stage: build
......@@ -13,6 +18,8 @@ build:
artifacts:
paths:
- public
only:
- master
prod-ftp:
stage: deploy
......@@ -25,9 +32,39 @@ prod-ftp:
- 'eval $(ssh-agent -s)'
- 'echo -e "Host *\n\tStrictHostKeyChecking no\nport 10022\n\n" > ~/.ssh/config'
- lftp -e "set dns:order 'inet inet6'; set net:timeout 5; set net:max-retries 2; set net:reconnect-interval-base 5; mirror --parallel=10 --delete --verbose -R public/ site/kszk/ ; quit" -u $FTP_USER,$FTP_PASS $FTP_HOST -p 10022
only:
- tags
container:
stage: container
dependencies:
- build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
script:
- |
/kaniko/executor --context ${CI_PROJECT_DIR} \
--dockerfile ${CI_PROJECT_DIR}/Dockerfile \
--destination ${CI_REGISTRY_IMAGE}:latest
only:
- master
except:
- tags
# staging-k8s:
# TODO
staging-k8s:
stage: deploy
image:
name: harbor.sch.bme.hu/k8s/kube-tools:latest
entrypoint: [""]
before_script:
- chmod 600 ${!KUBECONFIG_VAR_NAME}
- export KUBECONFIG=${!KUBECONFIG_VAR_NAME}
script:
- kubectl rollout restart deployment kszk-website
only:
- master
......@@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: kszk-website
namespace: utility
namespace: kszk-website
spec:
selector:
matchLabels:
......@@ -14,11 +14,10 @@ spec:
spec:
containers:
- name: kszk-website
image: harbor.sch.bme.hu/k8s/kszk-website:latest
image: harbor.sch.bme.hu/kszk/website:latest
resources:
limits:
memory: "128Mi"
cpu: "100m"
memory: "64Mi"
ports:
- containerPort: 80
imagePullSecrets:
......
......@@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kszk-website
namespace: utility
namespace: kszk-website
labels:
name: kszk-website
annotations:
......@@ -12,10 +12,10 @@ metadata:
spec:
tls:
- hosts:
- kszk-website.k8s-01.sch.bme.hu
- staging.kszk.sch.bme.hu
secretName: kszk-website-cert
rules:
- host: kszk-website.k8s-01.sch.bme.hu
- host: staging.kszk.sch.bme.hu
http:
paths:
- pathType: Prefix
......
......@@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: kszk-website
namespace: utility
namespace: kszk-website
spec:
selector:
app: kszk-website
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment