Skip to content
Snippets Groups Projects
Commit e35ac2dc authored by Paolo.Brasolin's avatar Paolo.Brasolin
Browse files

ci: #fe build and deploy to itch

parent 9a240b37
No related branches found
No related tags found
No related merge requests found
Pipeline #23055 passed
...@@ -27,7 +27,7 @@ stages: ...@@ -27,7 +27,7 @@ stages:
only: only:
- main - main
be-deploy-job: .be-deploy-job:
variables: variables:
KUBECTL_VERSION: v1.8.10 KUBECTL_VERSION: v1.8.10
IMAGE_NAME: $CI_REGISTRY_IMAGE/backend IMAGE_NAME: $CI_REGISTRY_IMAGE/backend
...@@ -82,3 +82,40 @@ be-deploy-job: ...@@ -82,3 +82,40 @@ be-deploy-job:
- cd frontend - cd frontend
- npm install - npm install
- echo Success! - echo Success!
fe-deploy-job:
variables:
GLIBC_URL: https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.34-r0/glibc-2.34-r0.apk
BUTLER_URL: https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
# NOTE: this key is a throwaway, we'll store one in secrets
BUTLER_API_KEY: 0UsKHAvtO2aXBJMPeR6bZHxSv9BRQ0zIvFPdFdRW
image: node:16-alpine
stage: deploy
cache:
- key:
files:
- frontend/package-lock.json
paths:
- frontend/node_modules
before_script:
- "#=[ install tools ]====================="
# NOTE: Alpine Linux stuff if linked with muslc. Butler is linked with glibc, and this causes an error -- see https://stackoverflow.com/a/66974607/6438061 for details. We need to install a compatibility layer: https://github.com/sgerrand/alpine-pkg-glibc#installing
- "#-[ install glibc ]---------------------"
- wget -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
- wget -O glibc.apk $GLIBC_URL
- apk add glibc.apk
- rm glibc.apk
- "#-[ install unzip ]---------------------"
- apk add --no-cache unzip
- "#-[ install butler ]--------------------"
- wget -O butler.zip $BUTLER_URL
- unzip butler.zip *.so -d /usr/local/lib
- unzip butler.zip butler -d /usr/local/bin
- chmod +x /usr/local/bin/butler
- rm butler.zip
- butler -V
script:
- cd frontend
- npm install
- npm run build
- butler push dist paolobrasolin/oetzi:html5
\ No newline at end of file
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
- ingress.yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: deployment
spec:
template:
spec:
containers:
- name: webserver
image: WEBSERVER
ports:
- name: http
containerPort: 80
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress
annotations:
ingress.kubernetes.io/configuration-snippet: |
rewrite ^(/PATH)$ $1/ permanent;
ingress.kubernetes.io/rewrite-target: /
kubernetes.io/tls-acme: "true"
spec:
rules:
- host: HOST
http:
paths:
- backend:
serviceName: service-http
servicePort: 80
path: /PATH
tls:
- hosts:
- kommul-dev.eurac.edu
secretName: kommul-dev.eurac.edu-NAME-tls
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../base
patchesStrategicMerge:
- deployment.yaml
- ingress.yaml
namePrefix: merlin-platform-
# nameSuffix: -v1
commonLabels:
variant: staging
org: commul
app: merlin-webpage
commonAnnotations:
note: merlin-platform-note
namespace: kommul-dev
images:
- name: WEBSERVER
newName: gitlab.inf.unibz.it:4567/commul/merlin-platform/www/master:445bc35dde4520cab61a36c793c7c5a626f43e62
patchesJSON6902:
- target:
group: extensions
version: v1beta1
kind: Ingress
name: ingress
patch: |-
- op: replace
path: /metadata/annotations/ingress.kubernetes.io~1configuration-snippet
value: |
rewrite ^(/merlin)$ $1/ permanent;
- op: replace
path: /spec/rules/0/host
value: kommul-dev.eurac.edu
- op: replace
path: /spec/rules/0/http/paths/0/path
value: /merlin
- op: replace
path: /spec/tls/0/secretName
value: kommul-dev.eurac.edu-merlin-tls
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment