Compare commits

...

3 Commits

Author SHA1 Message Date
4a383437f3 Fixed Makefile 2020-06-07 14:19:09 +01:00
d42758f54c Fixed PR CI jobs 2020-06-07 14:18:58 +01:00
7a4b1c96bc Enabled Traefik access logs 2020-06-06 22:04:20 +01:00
5 changed files with 79 additions and 12 deletions

View File

@ -17,7 +17,7 @@ format:
.PHONY: run-tests # Runs all tests
run-tests:
@echo "⚠️ 'run-tests' unimplemented"
@cd terraform && terraform plan
.PHONY: fetch-deps # Fetch all project dependencies
fetch-deps:
@ -41,11 +41,9 @@ run:
.PHONY: ci # Perform CI specific tasks to perform on a pull request
ci:
@cd terraform
@PLAN=$(terraform plan)
@curl -X "POST" "https://git.cluster.fun/api/v1/repos/AverageMarcus/${REPO}/issues/${PR_ID}/comments?access_token=${ACCESS_TOKEN}" \
@PLAN=$(cd terraform && terraform plan ./terraform) && curl -X "POST" "https://git.cluster.fun/api/v1/repos/AverageMarcus/${REPO}/issues/${PR_ID}/comments?access_token=${ACCESS_TOKEN}" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{"body": "<details><summary>Terraform Plan:</summary>'$PLAN'</details>"}'
-d $'{"body": "<details><summary>Terraform Plan:</summary>'"$PLAN"'</details>"}'
.PHONY: release # Release the latest version of the application
release:
@ -60,4 +58,4 @@ help:
@echo "-----------------------------------"
@grep '^.PHONY: .* #' Makefile | sed 's/\.PHONY: \(.*\) # \(.*\)/\1 \2/' | expand -t20
default: test build
default: test

View File

@ -37,23 +37,19 @@ spec:
resources:
requests:
memory: 64Mi
core:
resources:
requests:
memory: 64Mi
jobservice:
resources:
requests:
memory: 64Mi
registry:
registry:
resources:
requests:
memory: 64Mi
controller:
resources:
requests:

View File

@ -14,3 +14,62 @@ spec:
port: 443
name: https
type: LoadBalancer
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
k8s-app: traefik-ingress-lb
k8s.scw.cloud/ingress: traefik
k8s.scw.cloud/object: DaemonSet
k8s.scw.cloud/system: ingress
name: ingress-traefik
namespace: kube-system
spec:
revisionHistoryLimit: 10
selector:
matchLabels:
k8s-app: traefik-ingress-lb
template:
metadata:
labels:
k8s-app: traefik-ingress-lb
name: ingress-traefik
spec:
containers:
- args:
- --api
- --kubernetes
- --logLevel=INFO
- --defaultentrypoints=http,https
- --entrypoints=Name:https Address::443 TLS
- --entrypoints=Name:http Address::80
- --accesslog
- --accesslog.format=json
image: docker.io/traefik:1.7
imagePullPolicy: IfNotPresent
name: ingress-traefik
ports:
- containerPort: 80
hostPort: 80
name: http
protocol: TCP
- containerPort: 443
hostPort: 443
name: https
protocol: TCP
- containerPort: 8080
name: admin
protocol: TCP
securityContext:
capabilities:
add:
- NET_BIND_SERVICE
drop:
- ALL
dnsPolicy: ClusterFirst
restartPolicy: Always
serviceAccount: ingress-traefik
serviceAccountName: ingress-traefik

View File

@ -39,6 +39,12 @@ spec:
params:
- name: TARGET
value: "test"
- name: REPO
value: $(params.projectname)
- name: PR_ID
value: $(params.prid)
- name: SHA
value: $(params.gitrevision)
resources:
inputs:
- name: src
@ -55,6 +61,12 @@ spec:
params:
- name: TARGET
value: "build"
- name: REPO
value: $(params.projectname)
- name: PR_ID
value: $(params.prid)
- name: SHA
value: $(params.gitrevision)
resources:
inputs:
- name: src
@ -75,6 +87,8 @@ spec:
value: $(params.projectname)
- name: PR_ID
value: $(params.prid)
- name: SHA
value: $(params.gitrevision)
resources:
inputs:
- name: src

View File

@ -14,7 +14,7 @@ spec:
default: "pending"
steps:
- name: pr-status-update
image: docker.cluster.fun/averagemarcus/gitea-pr-state:latest
image: docker.cluster.fun/averagemarcus/gitea-pr-status:latest
env:
- name: ACCESS_TOKEN
valueFrom:
@ -22,6 +22,6 @@ spec:
name: gitea-access-token
key: access-token
args:
- "$(params.REPO)"
- "AverageMarcus/$(params.REPO)"
- "$(params.SHA)"
- "$(params.STATE)"