From 7f4254a6fd81cdf706ac29935d75adc06fc4f4af Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 09:42:57 +0200 Subject: [PATCH 01/18] Inital Rclone add --- .bumpversion.cfg | 2 + .github/lint-config.yaml | 1 + .github/workflows/build-and-publish.yaml | 22 +++++ .github/workflows/helm-lint.yaml | 14 +++ .github/workflows/helm-publish.yaml | 30 +++++++ .github/workflows/release.yaml | 26 ++++++ charts/.helmignore | 2 + charts/rclone-copy/Chart.yaml | 8 ++ charts/rclone-copy/README.md | 74 ++++++++++++++++ charts/rclone-copy/templates/_helpers.tpl | 29 ++++++ charts/rclone-copy/templates/configmap.yaml | 9 ++ charts/rclone-copy/templates/rclone-cron.yaml | 88 +++++++++++++++++++ charts/rclone-copy/values.yaml | 78 ++++++++++++++++ 13 files changed, 383 insertions(+) create mode 100644 .bumpversion.cfg create mode 100644 .github/lint-config.yaml create mode 100644 .github/workflows/build-and-publish.yaml create mode 100644 .github/workflows/helm-lint.yaml create mode 100644 .github/workflows/helm-publish.yaml create mode 100644 .github/workflows/release.yaml create mode 100644 charts/.helmignore create mode 100644 charts/rclone-copy/Chart.yaml create mode 100644 charts/rclone-copy/README.md create mode 100644 charts/rclone-copy/templates/_helpers.tpl create mode 100644 charts/rclone-copy/templates/configmap.yaml create mode 100644 charts/rclone-copy/templates/rclone-cron.yaml create mode 100644 charts/rclone-copy/values.yaml diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..5656231 --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,2 @@ +[bumpversion] +current_version = 0.0.1 \ No newline at end of file diff --git a/.github/lint-config.yaml b/.github/lint-config.yaml new file mode 100644 index 0000000..b225195 --- /dev/null +++ b/.github/lint-config.yaml @@ -0,0 +1 @@ +target-branch: "master" diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml new file mode 100644 index 0000000..8074368 --- /dev/null +++ b/.github/workflows/build-and-publish.yaml @@ -0,0 +1,22 @@ +name: Build and Publish + +on: + push: + tags: ["**"] + branches: ["**"] + +jobs: + build-and-publish: + name: Java Gradle + uses: bakdata/ci-templates/.github/workflows/java-gradle-library.yaml@1.43.0 + with: + java-version: 17 + secrets: + sonar-token: ${{ secrets.SONARCLOUD_TOKEN }} + sonar-organization: ${{ secrets.SONARCLOUD_ORGANIZATION }} + signing-secret-key-ring: ${{ secrets.SONATYPE_SIGNING_SECRET_KEY_RING }} + signing-key-id: ${{ secrets.SONATYPE_SIGNING_KEY_ID }} + signing-password: ${{ secrets.SONATYPE_SIGNING_PASSWORD }} + ossrh-username: ${{ secrets.SONATYPE_OSSRH_USERNAME }} + ossrh-password: ${{ secrets.SONATYPE_OSSRH_PASSWORD }} + github-token: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/helm-lint.yaml b/.github/workflows/helm-lint.yaml new file mode 100644 index 0000000..58cd9c4 --- /dev/null +++ b/.github/workflows/helm-lint.yaml @@ -0,0 +1,14 @@ +name: Helm lint + +on: + push: + +jobs: + helm-lint: + runs-on: ubuntu-22.04 + steps: + - name: Lint Helm chart + uses: bakdata/ci-templates/actions/helm-lint@1.46.3 + with: + lint-config-path: ".github/lint-config.yaml" + ref: ${{ github.ref_name }} diff --git a/.github/workflows/helm-publish.yaml b/.github/workflows/helm-publish.yaml new file mode 100644 index 0000000..9dc7b04 --- /dev/null +++ b/.github/workflows/helm-publish.yaml @@ -0,0 +1,30 @@ +name: Publish Helm Charts + +on: + push: + +jobs: + get-version: + name: Get version from bumpversion + outputs: + version: ${{ steps.get-version.outputs.VERSION }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Get current version from bumpversion + run: echo "VERSION=$(cat .bumpversion.cfg | sed -nE 's/.*current_version = (.*)/\1/p')${{}}" >> GITHUB_OUTPUT + shell: bash + + call-workflow-passing-data: + name: Publish Helm chart + uses: bakdata/ci-templates/.github/workflows/helm-multi-release.yaml@1.46.3 + needs: get-version + with: + charts-path: "./charts" + subdirs: "['rclone-copy']" + gh-pages-branch: gh-pages + version: ${{ needs.get-version.outputs.version }} + secrets: + github-username: ${{ secrets.GH_USERNAME }} + github-email: ${{ secrets.GH_EMAIL }} + github-token: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..d124b9c --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,26 @@ +name: Release + +on: + workflow_dispatch: + inputs: + release-type: + description: "The scope of the release (major, minor or patch)." + type: choice + required: true + default: patch + options: + - patch + - minor + - major + +jobs: + java-gradle-release: + name: Java Gradle + uses: bakdata/ci-templates/.github/workflows/java-gradle-release.yaml@1.43.0 + with: + java-version: 17 + release-type: "${{ inputs.release-type }}" + secrets: + github-email: "${{ secrets.GH_EMAIL }}" + github-username: "${{ secrets.GH_USERNAME }}" + github-token: "${{ secrets.GH_TOKEN }}" diff --git a/charts/.helmignore b/charts/.helmignore new file mode 100644 index 0000000..a1006ff --- /dev/null +++ b/charts/.helmignore @@ -0,0 +1,2 @@ +*.tgz +.* diff --git a/charts/rclone-copy/Chart.yaml b/charts/rclone-copy/Chart.yaml new file mode 100644 index 0000000..1ef2c03 --- /dev/null +++ b/charts/rclone-copy/Chart.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +name: rclone-copy +description: A helm chart for rclone copy on Kubernetes. +version: 1.0.0 +maintainers: + - name: bakdata + email: opensource@bakdata.com + url: bakdata.com diff --git a/charts/rclone-copy/README.md b/charts/rclone-copy/README.md new file mode 100644 index 0000000..df72a35 --- /dev/null +++ b/charts/rclone-copy/README.md @@ -0,0 +1,74 @@ +# rclone Helm for Kubernetes + +## Usage: +- Create `rclone.conf` (either via `rclone configure` or from `rclone.conf.template`) +- Adapt `values.yaml` to contain your values. +- Install helm with: `helm install . -f values.yaml -n "mySource-mySoruceType-myDestType"` in this directory. + +## Creating rclone.conf from scratch +- Download `rclone` (on Mac e.g. `brew install rclone`) +- Run the following commands: +```bash +cd my-repository +rclone config --config "rclone.conf" +``` +- Select `n` for "New remote" +- Enter name of source. The source name what you call the rclone copy command with. +- Select `10` for `ftp`. +- Enter ftp URL. Should not contain `ftp://`! +- Enter username. +- Enter port if different than 21. Otherwise just ENTER. +- Select `y` to add password. +- Add password twice. +- Select `n` to skip advanced settings. +- Select `y` to finish this config. + +Now step one is done. Next we need to add S3. +- Select `n` for new remote. +- The name should be "s3" (without quotes) +- Select `4` for AWS-compliant sources and then `1` for AWS as the provider. +- Select `2` to use credentials from the environment (we use IAM) +- Press ENTER to leave credentials blank. +- Press ENTER to leave access key blank. +- Select `9` for EU Frankfurt region. +- Press ENTER to to leave default endpoint. +- Select `9` for EU region. +- Press ENTER to leave default ACL (== private). +- Press ENTER to leave default server-side encryption. +- Press ENTER to leave default ARN. +- Press ENTER to leave default storage class. +- Select `n` to skip advanced settings. +- Select `y` to finish source. +- Select `q` to quit config and verfiy that the config is correct. + +Your config file should look like this now: +``` +[my-source] +type = ftp +host = ftp.my-source.com +user = my-user +pass = 1FbNBhe7ndNsFcjTVofIarv1oP3d + +[s3] +type = s3 +provider = AWS +env_auth = true +region = eu-central-1 +location_constraint = EU +``` + +Now we need to encrypt the file. +- `rclone config --config "rclone.conf"` to open config again. +- Select `s` to set configuration password. +- Select `a` to add own password. +- Enter the password twice. +- Select `q` to finish encryption. +- Select `q` to close config menu. + +The config file is now complete and should look something like this: +``` +# Encrypted rclone configuration File + +RCLONE_ENCRYPT_V0: +nUebCNSIfjPZ3484t4Q2iSm252SkPCbMgheI1b//xegm0Hv2Fb6d4SkjgnGii6jy+dVK9f9NVhdoEcG/o4g4XHTdpHKl8GzDwhY90wZZIpNH1ID45XSVeDvRWAJSbqiLtoss4gEfCVCf/QvPWbcPon6ZGFGN8XszH2S7wQhnjL2Uwl1BrE6NwRurvoZ+Hsp6ml1E1mny8iI1WGopLPjkqJCk5GT6nJmy2YyLZbOsO7bs4rJy0p3GM4KBw6VuTza4+WKWRlJweKFo3gHB85Xa8xbBgpznOAx+MUfTKXyvkmMkZlVc37tC0rv4 +``` diff --git a/charts/rclone-copy/templates/_helpers.tpl b/charts/rclone-copy/templates/_helpers.tpl new file mode 100644 index 0000000..4028b9c --- /dev/null +++ b/charts/rclone-copy/templates/_helpers.tpl @@ -0,0 +1,29 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "rclone-copy.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "rclone-copy.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Values.nameOverride -}} +{{- printf "%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "rclone-copy.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/charts/rclone-copy/templates/configmap.yaml b/charts/rclone-copy/templates/configmap.yaml new file mode 100644 index 0000000..6255f67 --- /dev/null +++ b/charts/rclone-copy/templates/configmap.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: rclone-config-{{ .Release.Name }} +data: + rclone.conf: | +{{ .Values.rcloneConf | indent 4 }} + include-pattern.conf: | +{{ .Values.includePattern | indent 4 }} diff --git a/charts/rclone-copy/templates/rclone-cron.yaml b/charts/rclone-copy/templates/rclone-cron.yaml new file mode 100644 index 0000000..7ddf601 --- /dev/null +++ b/charts/rclone-copy/templates/rclone-cron.yaml @@ -0,0 +1,88 @@ +{{- $root := . -}} +{{- if .Capabilities.APIVersions.Has "batch/v1/CronJob" }} +apiVersion: batch/v1 +{{- else }} +apiVersion: batch/v1beta1 +{{- end }} +kind: CronJob +metadata: + name: {{ template "rclone-copy.fullname" . }} +{{- if .Values.annotations }} + annotations: + {{- range $key, $value := .Values.annotations }} + {{ $key | quote }}: {{ $value | quote }} + {{- end }} +{{- end }} + labels: + app: {{ template "rclone-copy.name" . }} + chart: {{ template "rclone-copy.chart" . }} + release: {{ .Release.Name }} + {{- range $key, $value := .Values.labels }} + {{ $key }}: {{ $value }} + {{- end }} +spec: + suspend: {{ .Values.suspend }} + schedule: "{{ .Values.schedule }}" + successfulJobsHistoryLimit: {{ .Values.successfulJobsHistoryLimit }} + failedJobsHistoryLimit: {{ .Values.failedJobsHistoryLimit }} + concurrencyPolicy: Replace + jobTemplate: + spec: + template: + metadata: + {{- if .Values.podAnnotations }} + annotations: + {{- range $key, $value := .Values.podAnnotations }} + {{ $key | quote }}: {{ $value | quote }} + {{- end }} + {{- end }} + labels: + app: {{ template "rclone-copy.name" . }} + release: {{ .Release.Name }} + {{- range $key, $value := .Values.podLabels }} + {{ $key }}: {{ $value }} + {{- end }} + spec: + {{- if .Values.serviceAccountName }} + serviceAccountName: {{ .Values.serviceAccountName }} + {{- end }} + {{- if .Values.tolerations }} + tolerations: +{{ toYaml .Values.tolerations | indent 12 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- tpl (toYaml .) $root | nindent 12 }} + {{- end }} + containers: + - name: rclone-container + image: rclone/rclone:{{ .Values.imageRelease }} + + command: + - /bin/sh + args: + - -c + # copy as workaround for rclone.conf read only (see https://github.com/rclone/rclone/issues/3655) + - >- + cp /root/.config/rclone/rclone_ro.conf /root/.config/rclone/rclone.conf && + rclone copy -v {{ .Values.arguments | join " " }} --include-from /root/include-pattern.conf "{{ .Values.sync.source.name }}:{{ .Values.sync.source.path }}" "{{ .Values.sync.dest.name }}:{{ .Values.sync.dest.path }}" + + volumeMounts: + - name: config + # This is the default path where the rclone implementation assumes the config is located + mountPath: "/root/.config/rclone/rclone_ro.conf" + subPath: "rclone.conf" + - name: config + mountPath: "/root/include-pattern.conf" + subPath: "include-pattern.conf" + + resources: +{{ toYaml .Values.resources | indent 14 }} + + restartPolicy: {{ .Values.restartPolicy }} + volumes: + - name: config + configMap: + name: rclone-config-{{ .Release.Name }} + backoffLimit: {{ .Values.backoffLimit }} + diff --git a/charts/rclone-copy/values.yaml b/charts/rclone-copy/values.yaml new file mode 100644 index 0000000..ace2fc0 --- /dev/null +++ b/charts/rclone-copy/values.yaml @@ -0,0 +1,78 @@ +nameOverride: bakdata-rclone-copy + +# This is the cofiguration for the specific rclone-cronjob that you want to run. +# `sync` contains the config for the source and destination of the rclone copy job. +# It can be interpreted as: +# rclone copy {source.name}:{source.path} {dest.name}:{dest.path} +sync: + source: + # This is the name for the source remote from the rclone.conf file. + # If the value specified here is not present in the config file, the job will fail. + # See rclone.conf.template for an example. + name: my-sftp + + # This is the path to the source directory. + path: /tmp/sync-dir + + dest: + # This is the name for the destination remote from the rclone.conf file. + # If the value specified here is not present in the config file, the job will fail. + # See rclone.conf.template for an example. + name: my-s3 + + # This is the path to the target directory. + path: my-s3-bucket + +# Additional arguments to pass to rclone. +# The expected value is an array with comma seperated flag and value passed as a string. +# Example: ["--transfers", '"1"'] +arguments: [] + +# Pattern of files to copy. Standard UNIX file glob patterns are used. Default: "*" +# See templates/include-pattern-config.yaml for more details on usage in ConfigMap. +includePattern: "*" + +# Cron schedule for this connect job. Default is at 12:00 every day. +schedule: "0 12 * * *" + +suspend: false + +# Content of the rclone.conf file. +rcloneConf: "" + +# Release version for the openbridge/ob_bulkstash docker image. +# You probably don't need to change this. +imageRelease: 1.53.1 + +restartPolicy: OnFailure + +# serviceAccountName: foo + +tolerations: [] +# - key: "foo" +# operator: "Exists" +# effect: "NoSchedule" +# - key: "bar" +# operator: "Exists" +# effect: "NoSchedule" + +## Affinity for pod assignment (evaluated as template) +## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity +## +affinity: {} + +resources: + requests: + cpu: 200m + memory: 300Mi + limits: + memory: 2G + cpu: 500m + +successfulJobsHistoryLimit: 1 +failedJobsHistoryLimit: 1 +backoffLimit: 6 + +podAnnotations: {} + +podLabels: {} From 774b8439356b2ade08aee0f7a1beef9ad3717a12 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 09:46:15 +0200 Subject: [PATCH 02/18] fix: remove java build --- .github/workflows/build-and-publish.yaml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .github/workflows/build-and-publish.yaml diff --git a/.github/workflows/build-and-publish.yaml b/.github/workflows/build-and-publish.yaml deleted file mode 100644 index 8074368..0000000 --- a/.github/workflows/build-and-publish.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Build and Publish - -on: - push: - tags: ["**"] - branches: ["**"] - -jobs: - build-and-publish: - name: Java Gradle - uses: bakdata/ci-templates/.github/workflows/java-gradle-library.yaml@1.43.0 - with: - java-version: 17 - secrets: - sonar-token: ${{ secrets.SONARCLOUD_TOKEN }} - sonar-organization: ${{ secrets.SONARCLOUD_ORGANIZATION }} - signing-secret-key-ring: ${{ secrets.SONATYPE_SIGNING_SECRET_KEY_RING }} - signing-key-id: ${{ secrets.SONATYPE_SIGNING_KEY_ID }} - signing-password: ${{ secrets.SONATYPE_SIGNING_PASSWORD }} - ossrh-username: ${{ secrets.SONATYPE_OSSRH_USERNAME }} - ossrh-password: ${{ secrets.SONATYPE_OSSRH_PASSWORD }} - github-token: ${{ secrets.GH_TOKEN }} From 80ffe4c735e0206611b58918c358d9770097193e Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 09:47:28 +0200 Subject: [PATCH 03/18] fix: add runs on parameter --- .github/workflows/helm-publish.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/helm-publish.yaml b/.github/workflows/helm-publish.yaml index 9dc7b04..c771b1e 100644 --- a/.github/workflows/helm-publish.yaml +++ b/.github/workflows/helm-publish.yaml @@ -6,6 +6,7 @@ on: jobs: get-version: name: Get version from bumpversion + runs-on: ubuntu-latest outputs: version: ${{ steps.get-version.outputs.VERSION }} steps: From bf75246c043f08f4045605789ba8be5bafdc5265 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 09:48:05 +0200 Subject: [PATCH 04/18] fix: remove missing expression --- .github/workflows/helm-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-publish.yaml b/.github/workflows/helm-publish.yaml index c771b1e..d1dfa87 100644 --- a/.github/workflows/helm-publish.yaml +++ b/.github/workflows/helm-publish.yaml @@ -13,7 +13,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Get current version from bumpversion - run: echo "VERSION=$(cat .bumpversion.cfg | sed -nE 's/.*current_version = (.*)/\1/p')${{}}" >> GITHUB_OUTPUT + run: echo "VERSION=$(cat .bumpversion.cfg | sed -nE 's/.*current_version = (.*)/\1/p')" >> GITHUB_OUTPUT shell: bash call-workflow-passing-data: From 86d8e5dc9f68d6aeef6691f73ce30c5a28395c60 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 09:52:36 +0200 Subject: [PATCH 05/18] fix: set lint config to main branch --- .github/lint-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/lint-config.yaml b/.github/lint-config.yaml index b225195..21095dd 100644 --- a/.github/lint-config.yaml +++ b/.github/lint-config.yaml @@ -1 +1 @@ -target-branch: "master" +target-branch: "main" From 326f6eed11765118fb31ff1d2f3245cdd3e6503b Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 09:59:20 +0200 Subject: [PATCH 06/18] debug: add debug log version --- .github/workflows/helm-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-publish.yaml b/.github/workflows/helm-publish.yaml index d1dfa87..08660af 100644 --- a/.github/workflows/helm-publish.yaml +++ b/.github/workflows/helm-publish.yaml @@ -18,7 +18,7 @@ jobs: call-workflow-passing-data: name: Publish Helm chart - uses: bakdata/ci-templates/.github/workflows/helm-multi-release.yaml@1.46.3 + uses: bakdata/ci-templates/.github/workflows/helm-multi-release.yaml@tiedemann/fix-helm-publish needs: get-version with: charts-path: "./charts" From 6d2debf96eb305cd77f8bb7dfb8385e0b0c809fb Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 10:01:56 +0200 Subject: [PATCH 07/18] trigger ci From 924e0e12a51b6c573bd62ec00c472096ed646ed0 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 10:04:40 +0200 Subject: [PATCH 08/18] add debug output --- .github/workflows/helm-publish.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/helm-publish.yaml b/.github/workflows/helm-publish.yaml index 08660af..22e69db 100644 --- a/.github/workflows/helm-publish.yaml +++ b/.github/workflows/helm-publish.yaml @@ -8,12 +8,15 @@ jobs: name: Get version from bumpversion runs-on: ubuntu-latest outputs: - version: ${{ steps.get-version.outputs.VERSION }} + version: ${{ steps.get-version.outputs.version }} steps: - name: Checkout uses: actions/checkout@v4 - name: Get current version from bumpversion - run: echo "VERSION=$(cat .bumpversion.cfg | sed -nE 's/.*current_version = (.*)/\1/p')" >> GITHUB_OUTPUT + run: | + version=$(cat .bumpversion.cfg | sed -nE 's/.*current_version = (.*)/\1/p') + cat $version + echo "version=$version" >> GITHUB_OUTPUT shell: bash call-workflow-passing-data: From ce1cf42f5ce236b74ef3328cebe6a9cafae1a800 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 10:05:19 +0200 Subject: [PATCH 09/18] fix: echo instead of cat --- .github/workflows/helm-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-publish.yaml b/.github/workflows/helm-publish.yaml index 22e69db..16ebbbd 100644 --- a/.github/workflows/helm-publish.yaml +++ b/.github/workflows/helm-publish.yaml @@ -15,7 +15,7 @@ jobs: - name: Get current version from bumpversion run: | version=$(cat .bumpversion.cfg | sed -nE 's/.*current_version = (.*)/\1/p') - cat $version + echo $version echo "version=$version" >> GITHUB_OUTPUT shell: bash From b9e6b75a75d3b717ba1c635ee653050c16dae74e Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 10:07:01 +0200 Subject: [PATCH 10/18] fix: missing dollar sign --- .github/workflows/helm-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-publish.yaml b/.github/workflows/helm-publish.yaml index 16ebbbd..f3ea4c5 100644 --- a/.github/workflows/helm-publish.yaml +++ b/.github/workflows/helm-publish.yaml @@ -16,7 +16,7 @@ jobs: run: | version=$(cat .bumpversion.cfg | sed -nE 's/.*current_version = (.*)/\1/p') echo $version - echo "version=$version" >> GITHUB_OUTPUT + echo "version=$version" >> $GITHUB_OUTPUT shell: bash call-workflow-passing-data: From 351c37d928de87ed7a5d0fc701fc312fbdc77a27 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 10:09:16 +0200 Subject: [PATCH 11/18] fix: add missing id --- .github/workflows/helm-publish.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/helm-publish.yaml b/.github/workflows/helm-publish.yaml index f3ea4c5..7e290e5 100644 --- a/.github/workflows/helm-publish.yaml +++ b/.github/workflows/helm-publish.yaml @@ -13,6 +13,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Get current version from bumpversion + id: get-version run: | version=$(cat .bumpversion.cfg | sed -nE 's/.*current_version = (.*)/\1/p') echo $version From 72d740408f3dd7217f4909954cfa1b8f5f697b7a Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 10:14:02 +0200 Subject: [PATCH 12/18] fix: add snapshot suffix --- .github/workflows/helm-publish.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/helm-publish.yaml b/.github/workflows/helm-publish.yaml index 7e290e5..aa752b5 100644 --- a/.github/workflows/helm-publish.yaml +++ b/.github/workflows/helm-publish.yaml @@ -16,6 +16,9 @@ jobs: id: get-version run: | version=$(cat .bumpversion.cfg | sed -nE 's/.*current_version = (.*)/\1/p') + if [[ "${GITHUB_REF#refs/heads/}" != "main" && "${GITHUB_REF#refs/heads/}" != "master" ]]; then + version="${version}-SNAPSHOT" + fi echo $version echo "version=$version" >> $GITHUB_OUTPUT shell: bash From b76f69dab82d320917178b91565b8ff2163f18b9 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 10:42:45 +0200 Subject: [PATCH 13/18] fix: use proper release workflow --- .github/workflows/release.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d124b9c..659e838 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,9 +16,8 @@ on: jobs: java-gradle-release: name: Java Gradle - uses: bakdata/ci-templates/.github/workflows/java-gradle-release.yaml@1.43.0 + uses: bakdata/ci-templates/.github/workflows/bump-version-release.yaml@1.46.4 with: - java-version: 17 release-type: "${{ inputs.release-type }}" secrets: github-email: "${{ secrets.GH_EMAIL }}" From 59bdf50e83a70bc77241d954962b7b5904dce4f9 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 10:47:37 +0200 Subject: [PATCH 14/18] fix: set version of helm release to latest --- .github/workflows/helm-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/helm-publish.yaml b/.github/workflows/helm-publish.yaml index aa752b5..7bc04e4 100644 --- a/.github/workflows/helm-publish.yaml +++ b/.github/workflows/helm-publish.yaml @@ -25,7 +25,7 @@ jobs: call-workflow-passing-data: name: Publish Helm chart - uses: bakdata/ci-templates/.github/workflows/helm-multi-release.yaml@tiedemann/fix-helm-publish + uses: bakdata/ci-templates/.github/workflows/helm-multi-release.yaml@1.46.4 needs: get-version with: charts-path: "./charts" From 8922396fb8ce324615e326566f6b5a027ca7a7a1 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 10:50:39 +0200 Subject: [PATCH 15/18] fix: add proper naming to the release workflow --- .github/workflows/release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 659e838..dcaf8d9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,8 +14,8 @@ on: - major jobs: - java-gradle-release: - name: Java Gradle + bump-version-release: + name: Bumpversion Release uses: bakdata/ci-templates/.github/workflows/bump-version-release.yaml@1.46.4 with: release-type: "${{ inputs.release-type }}" From a6dd53d8b481f9960eb34aed7e6fd0f0137f46ee Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 16:42:06 +0200 Subject: [PATCH 16/18] fix: mirror current streams bootstrap version --- .bumpversion.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 5656231..8923e5e 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,2 +1,2 @@ [bumpversion] -current_version = 0.0.1 \ No newline at end of file +current_version = 2.23.0 \ No newline at end of file From ed0a9890fd2475a6394139bcbe96e6a4e3e7a018 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 16:44:59 +0200 Subject: [PATCH 17/18] fix: only add snapshot on tag --- .bumpversion.cfg | 2 +- .github/workflows/helm-publish.yaml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 8923e5e..e6dc42a 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,2 +1,2 @@ [bumpversion] -current_version = 2.23.0 \ No newline at end of file +current_version = 2.23.0 diff --git a/.github/workflows/helm-publish.yaml b/.github/workflows/helm-publish.yaml index 7bc04e4..d273d28 100644 --- a/.github/workflows/helm-publish.yaml +++ b/.github/workflows/helm-publish.yaml @@ -15,11 +15,10 @@ jobs: - name: Get current version from bumpversion id: get-version run: | - version=$(cat .bumpversion.cfg | sed -nE 's/.*current_version = (.*)/\1/p') - if [[ "${GITHUB_REF#refs/heads/}" != "main" && "${GITHUB_REF#refs/heads/}" != "master" ]]; then + version=$(sed -nE 's/.*current_version = (.*)/\1/p' < .bumpversion.cfg) + if ! [[ "$GITHUB_REF" =~ ^refs/tags/.* ]]; then version="${version}-SNAPSHOT" fi - echo $version echo "version=$version" >> $GITHUB_OUTPUT shell: bash From 33473e2ea51878eb3f98429bdbc36b7e56c2a6d3 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Fri, 28 Jun 2024 17:01:01 +0200 Subject: [PATCH 18/18] fix: shorten readme --- charts/rclone-copy/README.md | 60 +----------------------------------- 1 file changed, 1 insertion(+), 59 deletions(-) diff --git a/charts/rclone-copy/README.md b/charts/rclone-copy/README.md index df72a35..6aaecb0 100644 --- a/charts/rclone-copy/README.md +++ b/charts/rclone-copy/README.md @@ -13,62 +13,4 @@ cd my-repository rclone config --config "rclone.conf" ``` - Select `n` for "New remote" -- Enter name of source. The source name what you call the rclone copy command with. -- Select `10` for `ftp`. -- Enter ftp URL. Should not contain `ftp://`! -- Enter username. -- Enter port if different than 21. Otherwise just ENTER. -- Select `y` to add password. -- Add password twice. -- Select `n` to skip advanced settings. -- Select `y` to finish this config. - -Now step one is done. Next we need to add S3. -- Select `n` for new remote. -- The name should be "s3" (without quotes) -- Select `4` for AWS-compliant sources and then `1` for AWS as the provider. -- Select `2` to use credentials from the environment (we use IAM) -- Press ENTER to leave credentials blank. -- Press ENTER to leave access key blank. -- Select `9` for EU Frankfurt region. -- Press ENTER to to leave default endpoint. -- Select `9` for EU region. -- Press ENTER to leave default ACL (== private). -- Press ENTER to leave default server-side encryption. -- Press ENTER to leave default ARN. -- Press ENTER to leave default storage class. -- Select `n` to skip advanced settings. -- Select `y` to finish source. -- Select `q` to quit config and verfiy that the config is correct. - -Your config file should look like this now: -``` -[my-source] -type = ftp -host = ftp.my-source.com -user = my-user -pass = 1FbNBhe7ndNsFcjTVofIarv1oP3d - -[s3] -type = s3 -provider = AWS -env_auth = true -region = eu-central-1 -location_constraint = EU -``` - -Now we need to encrypt the file. -- `rclone config --config "rclone.conf"` to open config again. -- Select `s` to set configuration password. -- Select `a` to add own password. -- Enter the password twice. -- Select `q` to finish encryption. -- Select `q` to close config menu. - -The config file is now complete and should look something like this: -``` -# Encrypted rclone configuration File - -RCLONE_ENCRYPT_V0: -nUebCNSIfjPZ3484t4Q2iSm252SkPCbMgheI1b//xegm0Hv2Fb6d4SkjgnGii6jy+dVK9f9NVhdoEcG/o4g4XHTdpHKl8GzDwhY90wZZIpNH1ID45XSVeDvRWAJSbqiLtoss4gEfCVCf/QvPWbcPon6ZGFGN8XszH2S7wQhnjL2Uwl1BrE6NwRurvoZ+Hsp6ml1E1mny8iI1WGopLPjkqJCk5GT6nJmy2YyLZbOsO7bs4rJy0p3GM4KBw6VuTza4+WKWRlJweKFo3gHB85Xa8xbBgpznOAx+MUfTKXyvkmMkZlVc37tC0rv4 -``` +- Now continue to follow the outlined steps for the storage provider you chose