Compare commits

..

No commits in common. "8730911a5d0b2ea0c8e676738a4985a85df2b8d9" and "e932269f0431f41b68391f82d0959d84aca0bc06" have entirely different histories.

6 changed files with 22 additions and 115 deletions

View File

@ -5,8 +5,6 @@ name: staging
trigger: trigger:
event: event:
- push - push
branch:
- main
# STAGING!!!! # STAGING!!!!
steps: steps:
@ -63,8 +61,6 @@ steps:
- .drone/helm/staging-val.yaml - .drone/helm/staging-val.yaml
values: values:
- "image=dutchellie/proper-website-2:dev-${DRONE_COMMIT_SHA:0:8}" - "image=dutchellie/proper-website-2:dev-${DRONE_COMMIT_SHA:0:8}"
- "baseURL=staging.quenten.nl"
- "name=newsite-staging"
kube_api_server: kube_api_server:
from_secret: staging_api_server from_secret: staging_api_server
kube_token: kube_token:
@ -91,8 +87,6 @@ trigger:
- promote - promote
target: target:
- production - production
branch:
- main
# PRODUCTION!!!! # PRODUCTION!!!!
steps: steps:
@ -149,8 +143,6 @@ steps:
- .drone/helm/prod-val.yaml - .drone/helm/prod-val.yaml
values: values:
- "image=dutchellie/proper-website-2:latest-${DRONE_COMMIT_SHA:0:8}" - "image=dutchellie/proper-website-2:latest-${DRONE_COMMIT_SHA:0:8}"
- "baseURL=quenten.nl"
- "name=newsite-prod"
kube_api_server: kube_api_server:
from_secret: prod_api_server from_secret: prod_api_server
kube_token: kube_token:
@ -164,87 +156,4 @@ steps:
volumes: volumes:
- name: build - name: build
temp: {}
---
kind: pipeline
type: kubernetes
name: feature-branch
trigger:
event:
- push
branch:
exclude:
- main
# FEATURE DEPLOY
steps:
- name: build-wasm
image: golang:1.17.8-alpine
volumes:
- name: build-feature
path: /drone/src/build
environment:
APIURL: https://api.quenten.nl/api/testing
CGO_ENABLED: 0
commands:
- mkdir ./build/web
- GOARCH=wasm GOOS=js go build -o ./build/web/app.wasm -ldflags="-X 'main.ApiURL=$APIURL'" ./src
- name: build-server
image: golang:1.17.8-alpine
volumes:
- name: build-feature
path: /drone/src/build
environment:
APIURL: https://api.quenten.nl/api/testing
CGO_ENABLED: 0
commands:
- go build -o ./build/app -ldflags="-X 'main.ApiURL=$APIURL'" ./src
- name: build-publish-image
image: plugins/docker
privileged: true
volumes:
- name: build-feature
path: /drone/src/build
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
dockerfile: Dockerfile
repo: dutchellie/proper-website-2
tags:
- feature-${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:8}
depends_on:
- build-wasm
- build-server
- name: deploy-staging
image: pelotech/drone-helm3
settings:
mode: upgrade
chart: .drone/helm/chart
namespace: drone-staging
release: feature-${DRONE_BRANCH}
skip_tls_verify: true
values_files:
- .drone/helm/staging-val.yaml
values:
- "image=dutchellie/proper-website-2:feature-${DRONE_BRANCH}-${DRONE_COMMIT_SHA:0:8}"
- "baseURL=${DRONE_BRANCH}.quenten.nl"
- "name=${DRONE_BRANCH}-deployment"
kube_api_server:
from_secret: staging_api_server
kube_token:
from_secret: staging_kube_token
kube_certificate:
from_secret: staging_kube_certificate
kube_service_account: drone-deploy
dry_run: false
depends_on:
- build-publish-image
volumes:
- name: build-feature
temp: {} temp: {}

View File

@ -1,3 +1,3 @@
apiVersion: v2 apiVersion: v2
name: newsite name: newsite
version: v0.0.2 version: v0.0.1

View File

@ -1,11 +1,11 @@
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: {{ tpl .Values.ingress.name . }} name: {{ .Values.ingress.name }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
{{- with .Values.ingress.annotations }} {{- with .Values.ingress.annotations }}
annotations: annotations:
{{- tpl (. | toYaml) $ | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
spec: spec:
ingressClassName: {{ .Values.ingress.className }} ingressClassName: {{ .Values.ingress.className }}
@ -14,14 +14,14 @@ spec:
{{- range .Values.ingress.tls }} {{- range .Values.ingress.tls }}
- hosts: - hosts:
{{- range .hosts }} {{- range .hosts }}
- {{ tpl . $ | quote }} - {{ . | quote }}
{{- end }} {{- end }}
secretName: {{ tpl (.secretName | toYaml) $ }} secretName: {{ .secretName }}
{{- end }} {{- end }}
{{- end }} {{- end }}
rules: rules:
{{- range .Values.ingress.hosts }} {{- range .Values.ingress.hosts }}
- host: {{ tpl .host $ | quote }} - host: {{ .host | quote }}
http: http:
paths: paths:
{{- range .paths }} {{- range .paths }}
@ -29,7 +29,7 @@ spec:
pathType: {{ .pathType }} pathType: {{ .pathType }}
backend: backend:
service: service:
name: {{ tpl $.Values.service.name $ }} name: {{ $.Values.service.name }}
port: port:
number: 8000 number: 8000
{{- end }} {{- end }}

View File

@ -1,7 +1,7 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ tpl .Values.service.name . }} name: {{ .Values.service.name }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
{{- with .Values.service.annotations }} {{- with .Values.service.annotations }}
annotations: annotations:

View File

@ -1,24 +1,23 @@
baseURL: quenten.nl
name: newsite-prod name: newsite-prod
containerEnv: containerEnv:
- name: APIURL - name: APIURL
value: https://api.quenten.nl/api value: https://api.quenten.nl/api
service: service:
name: "{{ .Values.name }}" name: newsite-prod
ingress: ingress:
name: "{{ .Values.name }}" name: newsite-prod
annotations: annotations:
cert-manager.io/cluster-issuer: "letsencrypt-{{ .Values.name }}" cert-manager.io/cluster-issuer: letsencrypt-prod
external-dns.alpha.kubernetes.io/hostname: "{{ .Values.baseURL }}" external-dns.alpha.kubernetes.io/hostname: "quenten.nl"
nginx.ingress.kubernetes.io/configuration-snippet: | nginx.ingress.kubernetes.io/configuration-snippet: |
add_header Content-Security-Policy "frame-ancestors 'self' https://forestofunix.xyz"; add_header Content-Security-Policy "frame-ancestors 'self' https://forestofunix.xyz";
proxy_hide_header X-Frame-Options ; proxy_hide_header X-Frame-Options ;
tls: tls:
- hosts: - hosts:
- "{{ .Values.baseURL }}" - quenten.nl
secretName: "{{ .Values.name }}-tls" secretName: newsite-tls
hosts: hosts:
- host: "{{ .Values.baseURL }}" - host: quenten.nl
paths: paths:
- path: / - path: /
pathType: Prefix pathType: Prefix

View File

@ -1,24 +1,23 @@
baseURL: staging.quenten.nl
name: newsite-staging name: newsite-staging
containerEnv: containerEnv:
- name: APIURL - name: APIURL
value: https://api.quenten.nl/api/testing value: https://api.quenten.nl/api/testing
service: service:
name: "{{ .Values.name }}" name: newsite-staging
ingress: ingress:
name: "{{ .Values.name }}" name: newsite-staging
annotations: annotations:
cert-manager.io/cluster-issuer: "letsencrypt-{{ .Values.name }}" cert-manager.io/cluster-issuer: letsencrypt-staging
external-dns.alpha.kubernetes.io/hostname: "{{ .Values.baseURL }}" external-dns.alpha.kubernetes.io/hostname: "staging.quenten.nl"
nginx.ingress.kubernetes.io/configuration-snippet: | nginx.ingress.kubernetes.io/configuration-snippet: |
add_header Content-Security-Policy "frame-ancestors 'self' https://forestofunix.xyz"; add_header Content-Security-Policy "frame-ancestors 'self' https://forestofunix.xyz";
proxy_hide_header X-Frame-Options ; proxy_hide_header X-Frame-Options ;
tls: tls:
- hosts: - hosts:
- "{{ .Values.baseURL }}" - staging.quenten.nl
secretName: "{{ .Values.name }}-tls" secretName: newsite-staging-tls
hosts: hosts:
- host: "{{ .Values.baseURL }}" - host: staging.quenten.nl
paths: paths:
- path: / - path: /
pathType: Prefix pathType: Prefix