Merge branch 'main' of gitlab.com:domaindrivenarchitecture/c4k-gitea into main

This commit is contained in:
jerger 2022-12-09 14:05:31 +01:00
commit a25b031789
10 changed files with 107 additions and 12 deletions

22
copy-and-build-dda-io.sh Normal file
View file

@ -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)

View file

@ -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`

View file

@ -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
```
Done.

21
doc/Upgrading.md Normal file
View file

@ -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.

View file

@ -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",

View file

@ -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"

View file

@ -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]

View file

@ -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

View file

@ -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

View file

@ -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: