From 659029c05b9ee0642b77e5f9718be68a18d0aa00 Mon Sep 17 00:00:00 2001 From: Dev Mukherjee Date: Tue, 12 Sep 2023 15:43:55 +1000 Subject: [PATCH] refactor: build and release tasks fixes references to incorrect container build files, separates release and build tasks to make more sense, adds tasks for publishing the helm chart prepares for #45 --- Taskfile.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Taskfile.yml b/Taskfile.yml index 13c5c79..201a142 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -4,6 +4,19 @@ dotenv: ['.env'] tasks: build:image: + prompt: "Before we build, is the version number up to date?" + desc: builds a publishable docker image + cmds: + - | + docker buildx build \ + --platform=linux/amd64,linux/arm64 \ + -t ghcr.io/{{.ORG_NAME}}/{{.PACKAGE_NAME}}:v{{.PROJ_VER}} \ + -t ghcr.io/{{.ORG_NAME}}/{{.PACKAGE_NAME}}:latest \ + -f Dockerfile.prod . + vars: + PROJ_VER: + sh: "task version" + release:image: prompt: "Before we build, is the version number up to date?" desc: builds a publishable docker image cmds: @@ -13,7 +26,17 @@ tasks: --push \ -t ghcr.io/{{.ORG_NAME}}/{{.PACKAGE_NAME}}:v{{.PROJ_VER}} \ -t ghcr.io/{{.ORG_NAME}}/{{.PACKAGE_NAME}}:latest \ - -f Dockerfile . + -f Dockerfile.prod . + vars: + PROJ_VER: + sh: "task version" + release:chart: + prompt: "Before we build, is the version number up to date?" + desc: builds and publishes the helm chart for this project + dir: charts + cmds: + - helm package {{.PACKAGE_NAME}} + - helm push {{.PACKAGE_NAME}}-{{.PROJ_VER}}*.tgz oci://ghcr.io/{{.ORG_NAME}}/charts vars: PROJ_VER: sh: "task version"