Closed Sch3lp closed 2 years ago
sed
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:
deployment.yaml
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.
commithash
sed
on deployment with latest docker image sha to update meta:label so kubernetes picks it up as a change.In
deployment.yaml
there's then this:And
commithash
will be replaced.