SoftwareSandbox / effit-challenge

Web application for the PHUCIT Challenge. A week filled with challenges to make your Snowcase holiday even more memorable
MIT License
6 stars 2 forks source link

Set up TravisCI deploy to k8s on successful build #54

Closed Sch3lp closed 2 years ago

Sch3lp commented 5 years ago
sed -i "s|commithash|$CI_COMMIT_SHA|" ops/webapp/deployment.yaml
    - kubectl apply -f ops/webapp/deployment.yaml

In deployment.yaml there's then this:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: effit-deployment
  labels:
    app: effit-challenge-webapp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: effit-challenge-webapp
  template:
    metadata:
      labels:
        app: effit-challenge-webapp
        commit: commithash
      annotations:
        prometheus.io/path: "/actuator/prometheus"
        prometheus.io/port: "8082"
        prometheus.io/scrape: "true"
    spec:
      containers:
        - name: effit-app
          image: registry.gitlab.rotate-it.be/sch3lp/effit-challenge:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 8080

And commithash will be replaced.