From 650235b83d33a4b418d37e83606e3777d009b0ca Mon Sep 17 00:00:00 2001 From: Christian Lempa Date: Fri, 19 Apr 2024 15:23:14 +0200 Subject: [PATCH] docker git and file builds --- kestra/docker/file-build.yaml | 38 +++++++++++++++++++++++++++++++++++ kestra/docker/git-build.yaml | 29 ++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 kestra/docker/file-build.yaml create mode 100644 kestra/docker/git-build.yaml diff --git a/kestra/docker/file-build.yaml b/kestra/docker/file-build.yaml new file mode 100644 index 0000000..e0f5c23 --- /dev/null +++ b/kestra/docker/file-build.yaml @@ -0,0 +1,38 @@ +# Kestra Docker File Build Template +# --- +# +# Build a Docker image from a File. +# + +id: docker-file-build +namespace: # your-namespace + +tasks: + + - id: file + type: io.kestra.core.tasks.flows.WorkingDirectory + tasks: + - id: createFiles + type: io.kestra.core.tasks.storages.LocalFiles + inputs: + Dockerfile: | + FROM alpine:latest + WORKDIR /app + COPY . /app + RUN apk add --update python3 + CMD [ "python", "main.py"] + main.py: | + if __name__ == "__main__": + print("Hello from Docker!") + exit(0) + + - id: build + type: io.kestra.plugin.docker.Build + dockerfile: "src/Dockerfile" + tags: + - your-username/your-repository:your-tag + push: true + credentials: + registry: https://index.docker.io/v1/ + username: "{{ secret('YOUR_USERNAME') }}" + password: "{{ secret('YOUR_PASSWORD') }}" diff --git a/kestra/docker/git-build.yaml b/kestra/docker/git-build.yaml new file mode 100644 index 0000000..2e1f4c7 --- /dev/null +++ b/kestra/docker/git-build.yaml @@ -0,0 +1,29 @@ +# Kestra Docker Git Build Template +# --- +# +# Build a Docker image from a Git repository. +# + +id: docker-git-build +namespace: # your-namespace + +tasks: + + - id: git + type: io.kestra.core.tasks.flows.WorkingDirectory + tasks: + - id: clone + type: io.kestra.plugin.git.Clone + url: https://your-git-repo-url + branch: your-branch + + - id: build + type: io.kestra.plugin.docker.Build + dockerfile: "src/Dockerfile" + tags: + - your-username/your-repository:your-tag + push: true + credentials: + registry: https://index.docker.io/v1/ + username: "{{ secret('YOUR_USERNAME') }}" + password: "{{ secret('YOUR_PASSWORD') }}"