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 .PHONY: run-tests # Runs all tests
run-tests: run-tests:
@echo "⚠️ 'run-tests' unimplemented" @cd terraform && terraform plan
.PHONY: fetch-deps # Fetch all project dependencies .PHONY: fetch-deps # Fetch all project dependencies
fetch-deps: fetch-deps:
@ -41,11 +41,9 @@ run:
.PHONY: ci # Perform CI specific tasks to perform on a pull request .PHONY: ci # Perform CI specific tasks to perform on a pull request
ci: ci:
@cd terraform @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}" \
@PLAN=$(terraform plan)
@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' \ -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 .PHONY: release # Release the latest version of the application
release: release:
@ -60,4 +58,4 @@ help:
@echo "-----------------------------------" @echo "-----------------------------------"
@grep '^.PHONY: .* #' Makefile | sed 's/\.PHONY: \(.*\) # \(.*\)/\1 \2/' | expand -t20 @grep '^.PHONY: .* #' Makefile | sed 's/\.PHONY: \(.*\) # \(.*\)/\1 \2/' | expand -t20
default: test build default: test

View File

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

View File

@ -14,3 +14,62 @@ spec:
port: 443 port: 443
name: https name: https
type: LoadBalancer 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: params:
- name: TARGET - name: TARGET
value: "test" value: "test"
- name: REPO
value: $(params.projectname)
- name: PR_ID
value: $(params.prid)
- name: SHA
value: $(params.gitrevision)
resources: resources:
inputs: inputs:
- name: src - name: src
@ -55,6 +61,12 @@ spec:
params: params:
- name: TARGET - name: TARGET
value: "build" value: "build"
- name: REPO
value: $(params.projectname)
- name: PR_ID
value: $(params.prid)
- name: SHA
value: $(params.gitrevision)
resources: resources:
inputs: inputs:
- name: src - name: src
@ -75,6 +87,8 @@ spec:
value: $(params.projectname) value: $(params.projectname)
- name: PR_ID - name: PR_ID
value: $(params.prid) value: $(params.prid)
- name: SHA
value: $(params.gitrevision)
resources: resources:
inputs: inputs:
- name: src - name: src

View File

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