From 0bfd66b78db32488a6298032f3556ae0eeaf77d2 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Sat, 25 Feb 2023 12:44:29 +0100 Subject: [PATCH] Use commit hash as image tag --- .drone.yml | 14 +------------- kube/applicationset.yaml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 kube/applicationset.yaml diff --git a/.drone.yml b/.drone.yml index 9427939..566664b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,8 +7,6 @@ type: kubernetes name: Build badhouseplants.net trigger: - branch: - - main event: - push @@ -29,16 +27,6 @@ steps: commands: - git submodule update --init --recursive -- name: Get static content - image: rclone/rclone:latest - environment: - RCLONE_CONFIG_CONTENT: - from_secret: RCLONE_CONFIG_CONTENT - RCLONE_CONFIG: /tmp/rclone.conf - commands: - - echo "$RCLONE_CONFIG_CONTENT" > $RCLONE_CONFIG - - rclone copy -P badhouseplants-public:/badhouseplants-static static - - name: Build and push the docker image image: plugins/docker settings: @@ -47,7 +35,7 @@ steps: password: from_secret: GITEA_TOKEN repo: git.badhouseplants.net/allanger/badhouseplants-net - tags: latest + tags: ${DRONE_COMMIT_SHA} depends_on: - Init git submodules with themes - Get static content diff --git a/kube/applicationset.yaml b/kube/applicationset.yaml new file mode 100644 index 0000000..4f05c71 --- /dev/null +++ b/kube/applicationset.yaml @@ -0,0 +1,30 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: badhouseplants-net + namespace: argo-system +spec: + generators: + - list: + elements: + - name: dynamic-charts + app: badhouseplants + branch: dynamic-charts + template: + metadata: + name: "{{ app }}-{{ name }}" + namespace: argo-system + spec: + project: "default" + source: + helm: + valueFiles: + - values.yaml + values: |- + {{ values }} + repoURL: https://git.badhouseplants.net/api/packages/allanger/helm + targetRevision: "{{ chart.version }}" + chart: badhouseplants-net + destination: + server: "{{ argo.cluster }}" + namespace: "{{ app }}-{{ name }}"