feat: instance_name == branch

This commit is contained in:
ange 2024-05-15 19:48:31 +02:00
parent c8a88a578d
commit 45db247301
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
6 changed files with 9 additions and 6 deletions

2
.env
View File

@ -1,2 +1,2 @@
PROD_URL=apps.gmoker.com
IMAGEAPP=ghcr.io/gethomepage/homepage:v0.8.12
IMAGEAPP=ghcr.io/gethomepage/homepage:v0.8.13

View File

@ -15,6 +15,7 @@ jobs:
fi
cat <<EOF >> .env
BASE_URL="$BASE_URL"
INSTANCE_NAME="${{ gitea.ref_name }}"
EOF
cat .env

View File

@ -3,4 +3,4 @@
# https://gethomepage.dev/latest/configs/settings
headerStyle: clean
instanceName: public
instanceName: "$INSTANCE_NAME"

View File

@ -30,9 +30,11 @@ function kgcmkey() {
kubectl get configmap "$cm" -o jsonpath="{.data.$key}"
}
mapfile -t files "$(printf -- '--from-file=%s\n' config/*)"
kcreatecm homepage-config "${files[@]}"
cmd=(kcreatecm homepage-config)
for f in config/*; do
cmd+=("--from-file=$f=<(envsubst \"\$(env | xargs printf '$%s ')\" < $f)")
done
eval "${cmd[*]}"
kapply common/clusterrole.yaml common/app.yaml

View File

@ -44,7 +44,6 @@ metadata:
labels:
app: app
spec:
revisionHistoryLimit: 3
replicas: $NB_REPLICAS
selector:
matchLabels:

View File

@ -29,3 +29,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: homepage
namespace: "$K8S_NS"