Ship the customizations as a Docker image
The Docker image is used in the initialization process, to copy everything in the custom folder to the Gitea data dir (mounted as a persistent volume). It is built using Packer and is based on the busybox image, so we can use its minimalist shell system to copy files and set permissions
This commit is contained in:
7
script/build_customizations_image
Executable file
7
script/build_customizations_image
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# fail fast
|
||||
set -e
|
||||
|
||||
cd packer/
|
||||
packer build custom.json
|
||||
cd -
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
for podname in $(kubectl get pods -l name=gitea-server -o json \
|
||||
| jq -r '.items[].metadata.name'); do
|
||||
for path in ./kubernetes/custom/*; do
|
||||
echo "Copying ${path}..."
|
||||
kubectl cp "${path}" "${podname}":"/data/gitea/"
|
||||
done
|
||||
# Fix permissions
|
||||
kubectl exec "${podname}" -- chown -R 1000:1000 /data/gitea/
|
||||
done
|
||||
Reference in New Issue
Block a user