From fda85c7fb0b1ad879bf7b04eb52f6c32c792f6a1 Mon Sep 17 00:00:00 2001 From: erik Date: Tue, 18 Oct 2022 13:20:35 +0200 Subject: [PATCH 01/11] Fix browser spec error --- src/main/cljs/dda/c4k_gitea/browser.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/cljs/dda/c4k_gitea/browser.cljs b/src/main/cljs/dda/c4k_gitea/browser.cljs index 42954bc..c5aeda4 100644 --- a/src/main/cljs/dda/c4k_gitea/browser.cljs +++ b/src/main/cljs/dda/c4k_gitea/browser.cljs @@ -87,7 +87,7 @@ (br/validate! "app-name" ::gitea/default-app-name :optional true) (br/validate! "domain-whitelist" ::gitea/service-domain-whitelist :optional true) (br/validate! "volume-total-storage-size" ::gitea/volume-total-storage-size :deserializer js/parseInt) - (br/validate! "auth" core/auth? :deserializer edn/read-string) + (br/validate! "auth" gitea/auth? :deserializer edn/read-string) (br/set-form-validated!)) (defn add-validate-listener [name] From 438f4dc1d9bf21970452f8392a1ea0c2bab61d0c Mon Sep 17 00:00:00 2001 From: erik Date: Tue, 18 Oct 2022 13:27:03 +0200 Subject: [PATCH 02/11] Add automation for testing browser code --- copy-and-build-dda-io.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 copy-and-build-dda-io.sh diff --git a/copy-and-build-dda-io.sh b/copy-and-build-dda-io.sh new file mode 100644 index 0000000..4449369 --- /dev/null +++ b/copy-and-build-dda-io.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# set things +set -o nounset +set -o xtrace +set -o errexit +set -eo pipefail + +# dirs +srcDir="/home/$USER/" +srcName="main.js" +targetDir="/home/$USER/" +targetName="c4k-gitea.js" + +echo "build" +shadow-cljs compile frontend + +echo "move and rename file" +cp $srcDir$srcName $targetDir$targetName + +echo "build" +(cd $targetDir; lein ring server) From b4dc78965bad0d90f8f25461b193006e7e59e882 Mon Sep 17 00:00:00 2001 From: Clemens Date: Fri, 21 Oct 2022 11:01:50 +0200 Subject: [PATCH 03/11] Fixed db-backup cron problem --- doc/BackupAndRestore.md | 2 +- src/main/resources/backup/cron.yaml | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/doc/BackupAndRestore.md b/doc/BackupAndRestore.md index b15d4a1..31c7aa4 100644 --- a/doc/BackupAndRestore.md +++ b/doc/BackupAndRestore.md @@ -21,7 +21,7 @@ 1. apply backup-and-restore pod: `kubectl scale deployment backup-restore --replicas=1` -2. exec into pod and execute restore pod (press tab to get your exact pod name) +2. exec into pod and execute backup pod (press tab to get your exact pod name) `kubectl exec -it backup-restore-... -- /usr/local/bin/backup.sh` 3. remove backup-and-restore pod: `kubectl scale deployment backup-restore --replicas=0` diff --git a/src/main/resources/backup/cron.yaml b/src/main/resources/backup/cron.yaml index 7ee682e..5282c54 100644 --- a/src/main/resources/backup/cron.yaml +++ b/src/main/resources/backup/cron.yaml @@ -18,6 +18,27 @@ spec: imagePullPolicy: IfNotPresent command: ["/entrypoint.sh"] env: + - name: POSTGRES_USER + valueFrom: + secretKeyRef: + name: postgres-secret + key: postgres-user + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: postgres-secret + key: postgres-password + - name: POSTGRES_DB + valueFrom: + configMapKeyRef: + name: postgres-config + key: postgres-db + - name: POSTGRES_HOST + value: "postgresql-service:5432" + - name: POSTGRES_SERVICE + value: "postgresql-service" + - name: POSTGRES_PORT + value: "5432" - name: AWS_DEFAULT_REGION value: eu-central-1 - name: AWS_ACCESS_KEY_ID_FILE @@ -31,6 +52,8 @@ spec: key: restic-repository - name: RESTIC_PASSWORD_FILE value: /var/run/secrets/backup-secrets/restic-password + - name: CERTIFICATE_FILE + value: "" volumeMounts: - name: gitea-data-volume mountPath: /var/backups From 339b646283061312fa8bf80bd75730348ec5e6ce Mon Sep 17 00:00:00 2001 From: erik Date: Fri, 21 Oct 2022 15:38:07 +0200 Subject: [PATCH 04/11] [Skip-CI] Add Upgrading Doc Update Release Doc. --- doc/Releasing.md | 41 +++++++++++++++++++++++++++++++++++------ doc/Upgrading.md | 22 ++++++++++++++++++++++ 2 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 doc/Upgrading.md diff --git a/doc/Releasing.md b/doc/Releasing.md index e3aa755..7b8bf3c 100644 --- a/doc/Releasing.md +++ b/doc/Releasing.md @@ -1,14 +1,43 @@ -# stable release (should be done from master) +# Release process +## ... for testing (snapshots) + +Make sure your clojars.org credentials are correctly set in your ~/.lein/profiles.clj file. + +``` bash +git add . +git commit ``` -#adjust [version] -vi package.json +``` bash +lein deploy # or lein deploy clojars +``` + +## ... for stable release + +Make sure tags are protected in gitlab: +Repository Settings -> Protected Tags -> set \*.\*.\* as tag and save. + +``` bash +git checkout main # for old projects replace main with master +git add . +git commit +``` + +Open package.json, find ":version" keyword and remove "-SNAPSHOT" from version number. + +``` bash +git add . +git commit -m "Release [version]" lein release git push --follow-tags +``` -# bump version - increase version and add -SNAPSHOT -vi package.json +Open package.json again, increase version increment by one and add "-SNAPSHOT". + +``` bash git commit -am "version bump" git push -``` \ No newline at end of file +``` + +Done. diff --git a/doc/Upgrading.md b/doc/Upgrading.md new file mode 100644 index 0000000..7483c6e --- /dev/null +++ b/doc/Upgrading.md @@ -0,0 +1,22 @@ +# Release process + +## adhoc (on kubernetes cluster) + +Make sure you've got your gitea admin credentials. + +``` bash +kubectl edit deployments [website-pod-deployment-name] +# search for your current gitea version, e.g. 1.17.0 +# replace with new version +# save and exit +kubectl scale deployment meissa-io-deployment --replicas=0 +kubectl scale deployment meissa-io-deployment --replicas=1 +``` + +Visit your gitea url. +The inital installation screen should be visible. +Enter your admin credentials. + +You now should be logged into the admin account with all repos visible. + +You may want to update your c4k-gitea resources to reflect the changes made on the cluster. From b6281ae3e6b3ec3481b32822274ac9d4892bb168 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 2 Nov 2022 13:08:56 +0100 Subject: [PATCH 05/11] [Skip-CI] Bump gitea version --- src/main/resources/gitea/appini-env-configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/gitea/appini-env-configmap.yaml b/src/main/resources/gitea/appini-env-configmap.yaml index 55827e6..e55e932 100644 --- a/src/main/resources/gitea/appini-env-configmap.yaml +++ b/src/main/resources/gitea/appini-env-configmap.yaml @@ -62,7 +62,7 @@ data: GITEA__repository__TEMP_PATH: /data/gitea/uploads #[security] - GITEA__security__INSTALL_LOCK: "false" + GITEA__security__INSTALL_LOCK: "true" #[server] GITEA__server__DOMAIN: FQDN From 02bb23d1077834df48d482ab6e9987d2fb620281 Mon Sep 17 00:00:00 2001 From: bom Date: Wed, 2 Nov 2022 13:10:13 +0100 Subject: [PATCH 06/11] bump gitea version to 1.17.3 --- src/main/resources/gitea/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/gitea/deployment.yaml b/src/main/resources/gitea/deployment.yaml index f3d9e19..1fe6c58 100644 --- a/src/main/resources/gitea/deployment.yaml +++ b/src/main/resources/gitea/deployment.yaml @@ -18,7 +18,7 @@ spec: spec: containers: - name: gitea - image: gitea/gitea:1.17.0 + image: gitea/gitea:1.17.3 imagePullPolicy: IfNotPresent # config settings envFrom: From bf16cdd02cacd3e1b2133a96992da308f007859f Mon Sep 17 00:00:00 2001 From: bom Date: Wed, 2 Nov 2022 13:15:15 +0100 Subject: [PATCH 07/11] update Upgrading documentation to be gitea specific --- doc/Upgrading.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/doc/Upgrading.md b/doc/Upgrading.md index 7483c6e..11bad06 100644 --- a/doc/Upgrading.md +++ b/doc/Upgrading.md @@ -1,22 +1,21 @@ -# Release process +# Upgrading process ## adhoc (on kubernetes cluster) Make sure you've got your gitea admin credentials. ``` bash -kubectl edit deployments [website-pod-deployment-name] +kubectl edit configmap gitea-env +# make sure INSTALL_LOCK under security is set to true to disable the installation screen +# save and exit +kubectl edit deployments gitea # search for your current gitea version, e.g. 1.17.0 # replace with new version # save and exit -kubectl scale deployment meissa-io-deployment --replicas=0 -kubectl scale deployment meissa-io-deployment --replicas=1 +kubectl scale deployment gitea --replicas=0 +kubectl scale deployment gitea --replicas=1 ``` -Visit your gitea url. -The inital installation screen should be visible. -Enter your admin credentials. - You now should be logged into the admin account with all repos visible. -You may want to update your c4k-gitea resources to reflect the changes made on the cluster. +You may want to update your c4k-gitea resources to reflect the changes made on the cluster. \ No newline at end of file From 826905be957abb1caf2875af9a5c635d58f3cb9e Mon Sep 17 00:00:00 2001 From: bom Date: Wed, 2 Nov 2022 13:21:49 +0100 Subject: [PATCH 08/11] Release 1.0.0 --- package.json | 2 +- project.clj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a4e4e53..2301382 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "c4k-gitea", "description": "Generate c4k yaml for a gitea deployment.", "author": "meissa GmbH", - "version": "0.1.1-SNAPSHOT", + "version": "1.0.0", "homepage": "https://gitlab.com/domaindrivenarchitecture/c4k-gitea#readme", "repository": "https://www.npmjs.com/package/c4k-gitea", "license": "APACHE2", diff --git a/project.clj b/project.clj index 9d1bcb5..75284a1 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject org.domaindrivenarchitecture/c4k-gitea "0.1.1-SNAPSHOT" +(defproject org.domaindrivenarchitecture/c4k-gitea "1.0.0-SNAPSHOT" :description "gitea c4k-installation package" :url "https://domaindrivenarchitecture.org" :license {:name "Apache License, Version 2.0" From 8bb51aff4e9cafd715f355f9a6856599573c814a Mon Sep 17 00:00:00 2001 From: bom Date: Wed, 2 Nov 2022 13:22:00 +0100 Subject: [PATCH 09/11] Version 1.0.0 --- project.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.clj b/project.clj index 75284a1..0ac5544 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject org.domaindrivenarchitecture/c4k-gitea "1.0.0-SNAPSHOT" +(defproject org.domaindrivenarchitecture/c4k-gitea "1.0.0" :description "gitea c4k-installation package" :url "https://domaindrivenarchitecture.org" :license {:name "Apache License, Version 2.0" From 13a21845cb6439a5a18422a39e472829439bdd60 Mon Sep 17 00:00:00 2001 From: bom Date: Wed, 2 Nov 2022 13:22:46 +0100 Subject: [PATCH 10/11] version bump --- package.json | 2 +- project.clj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2301382..1d1b58f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "c4k-gitea", "description": "Generate c4k yaml for a gitea deployment.", "author": "meissa GmbH", - "version": "1.0.0", + "version": "1.0.1-SNAPSHOT", "homepage": "https://gitlab.com/domaindrivenarchitecture/c4k-gitea#readme", "repository": "https://www.npmjs.com/package/c4k-gitea", "license": "APACHE2", diff --git a/project.clj b/project.clj index 0ac5544..90a04f2 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject org.domaindrivenarchitecture/c4k-gitea "1.0.0" +(defproject org.domaindrivenarchitecture/c4k-gitea "1.0.1-SNAPSHOT" :description "gitea c4k-installation package" :url "https://domaindrivenarchitecture.org" :license {:name "Apache License, Version 2.0" From d8dfb56da75d5957ed320b55cd8a508bf1150ee0 Mon Sep 17 00:00:00 2001 From: erik Date: Thu, 3 Nov 2022 14:10:20 +0100 Subject: [PATCH 11/11] [Skip-CI]] Update doc --- doc/Upgrading.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Upgrading.md b/doc/Upgrading.md index 11bad06..5b83777 100644 --- a/doc/Upgrading.md +++ b/doc/Upgrading.md @@ -2,7 +2,7 @@ ## adhoc (on kubernetes cluster) -Make sure you've got your gitea admin credentials. +Ssh into your kubernetes cluster running the gitea instance. ``` bash kubectl edit configmap gitea-env @@ -16,6 +16,6 @@ kubectl scale deployment gitea --replicas=0 kubectl scale deployment gitea --replicas=1 ``` -You now should be logged into the admin account with all repos visible. +Logging into the admin account should now show the new version. You may want to update your c4k-gitea resources to reflect the changes made on the cluster. \ No newline at end of file