diff --git a/.github/workflows/kubernetes-cd.yml b/.github/workflows/kubernetes-cd.yml index 9737ba3..2127691 100644 --- a/.github/workflows/kubernetes-cd.yml +++ b/.github/workflows/kubernetes-cd.yml @@ -62,3 +62,14 @@ jobs: uses: docker://lachlanevenson/k8s-kubectl with: args: --kubeconfig=/github/workspace/.kubeconfig rollout status -n apps deployment/christinewebsite + - name: Ping Google + uses: docker://lachlanevenson/k8s-kubectl + with: + args: --kubeconfig=/github/workspace/.kubeconfig apply -f /github/workspace/k8s/job/yml + - name: Sleep + run: | + sleep 5 + - name: Don't Ping Google + uses: docker://lachlanevenson/k8s-kubectl + with: + args: --kubeconfig=/github/workspace/.kubeconfig delete -f /github/workspace/k8s/job/yml diff --git a/Dockerfile b/Dockerfile index 2e82e78..0551fc6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM xena/go:1.12.6 AS build +FROM xena/go:1.13.3 AS build ENV GOPROXY https://cache.greedo.xeserv.us COPY . /site WORKDIR /site @@ -7,7 +7,6 @@ RUN CGO_ENABLED=0 GOBIN=/root go install -v ./cmd/site FROM xena/alpine EXPOSE 5000 -RUN apk add --no-cache bash WORKDIR /site COPY --from=build /root/site . COPY ./static /site/static @@ -15,7 +14,5 @@ COPY ./templates /site/templates COPY ./blog /site/blog COPY ./talks /site/talks COPY ./css /site/css -COPY ./app /app -COPY ./app.json . HEALTHCHECK CMD wget --spider http://127.0.0.1:5000/.within/health || exit 1 CMD ./site diff --git a/app.json b/app.json deleted file mode 100644 index 9d7a7a1..0000000 --- a/app.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "scripts": { - "dokku": { - "postdeploy": "curl https://www.google.com/ping?sitemap=https://christine.website/sitemap.xml" - } - } -} diff --git a/app/CHECKS b/app/CHECKS deleted file mode 100644 index adfecdb..0000000 --- a/app/CHECKS +++ /dev/null @@ -1 +0,0 @@ -/ Christine \ No newline at end of file diff --git a/k8s/job.yml b/k8s/job.yml new file mode 100644 index 0000000..e5cf4eb --- /dev/null +++ b/k8s/job.yml @@ -0,0 +1,31 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: christinewebsite-ping + namespace: apps + labels: + app: christinewebsite +spec: + template: + spec: + containers: + - name: ping-bing + image: xena/alpine + command: + - "busybox" + - "wget" + - "-O" + - "-" + - "-q" + - "https://www.bing.com/ping?sitemap=https://christine.website/sitemap.xml" + - name: ping-google + image: xena/alpine + command: + - "busybox" + - "wget" + - "-O" + - "-" + - "-q" + - "https://www.google.com/ping?sitemap=https://christine.website/sitemap.xml" + restartPolicy: Never + backoffLimit: 4 diff --git a/run.sh b/run.sh deleted file mode 100755 index 1bf4f0d..0000000 --- a/run.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -cd /site -./site diff --git a/scripts/deploy.sh b/scripts/deploy.sh deleted file mode 100755 index 40776d4..0000000 --- a/scripts/deploy.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -set -e -set -x - -docker build . -git push dokku master diff --git a/scripts/setupremote.sh b/scripts/setupremote.sh deleted file mode 100755 index 14c4480..0000000 --- a/scripts/setupremote.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -set -e -set -x - -git remote add dokku dokku@minipaas.xeserv.us:christine