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) 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/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 +``` + +``` bash +lein deploy # or lein deploy clojars ``` -#adjust [version] -vi package.json +## ... 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..5b83777 --- /dev/null +++ b/doc/Upgrading.md @@ -0,0 +1,21 @@ +# Upgrading process + +## adhoc (on kubernetes cluster) + +Ssh into your kubernetes cluster running the gitea instance. + +``` bash +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 gitea --replicas=0 +kubectl scale deployment gitea --replicas=1 +``` + +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 diff --git a/package.json b/package.json index a4e4e53..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": "0.1.1-SNAPSHOT", + "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 9d1bcb5..90a04f2 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.1-SNAPSHOT" :description "gitea c4k-installation package" :url "https://domaindrivenarchitecture.org" :license {:name "Apache License, Version 2.0" 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] 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 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 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: