diff --git a/concourse/build.yaml b/concourse/build.yaml new file mode 100644 index 0000000..ca9a9b4 --- /dev/null +++ b/concourse/build.yaml @@ -0,0 +1,24 @@ +platform: linux + +image_resource: + type: registry-image + source: + repository: concourse/oci-build-task + +inputs: + - name: project-src + path: . + +outputs: + - name: image + +caches: + - path: cache + +params: + CONTEXT: . + # Reference: https://concourse-ci.org/building-an-image-and-using-it-in-a-task.html#build-the-image + UNPACK_ROOTFS: true + +run: + path: build diff --git a/concourse/prepare-deployment-resources.yaml b/concourse/prepare-deployment-resources.yaml new file mode 100644 index 0000000..ab371da --- /dev/null +++ b/concourse/prepare-deployment-resources.yaml @@ -0,0 +1,21 @@ +platform: linux + +image_resource: + type: registry-image + source: + repository: alpine + +inputs: + - name: project-src + path: . + +outputs: + - name: deploy-confs + +run: + path: sh + args: + - -exc + - | + VERSION=$( cat commit.sha ) + sed "s/IMAGE_TAG/$VERSION/g" k8s/deployments.yaml >> deploy-confs/prod.yaml diff --git a/k8s/deployments.yaml b/k8s/deployments.yaml index f3e25f1..83d9f9a 100644 --- a/k8s/deployments.yaml +++ b/k8s/deployments.yaml @@ -26,7 +26,7 @@ spec: mountPath: "/app/cache" containers: - name: web - image: registry.k8s.astropenguin.net/astrojs:2022.04.19 + image: registry.k8s.astropenguin.net/astrojs:IMAGE_TAG securityContext: runAsGroup: 1001 runAsNonRoot: true @@ -54,7 +54,7 @@ spec: - name: redis image: redis:6.0.8-alpine - name: compiler - image: registry.k8s.astropenguin.net/astrojs:2022.04.19 + image: registry.k8s.astropenguin.net/astrojs:IMAGE_TAG securityContext: runAsGroup: 1001 runAsNonRoot: true