mirror of
https://github.com/GothenburgBitFactory/taskchampion-sync-server.git
synced 2026-07-16 08:24:45 +00:00
Compare commits
2 Commits
taskchampi
...
bp99-gitea
| Author | SHA1 | Date | |
|---|---|---|---|
|
90a73ea7bd
|
|||
|
a08cda96ce
|
57
.gitea/workflows/docker.yaml
Normal file
57
.gitea/workflows/docker.yaml
Normal file
@ -0,0 +1,57 @@
|
||||
---
|
||||
name: docker-publish
|
||||
on: [push, workflow_dispatch]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up docker
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Log in to the Gitea container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ gitea.server_url }}
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.PACKAGES_TOKEN }}
|
||||
- name: Extract metadata for SQLite image
|
||||
id: meta-sqlite
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: gitea.bp99.eu/${{ gitea.repository }}
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=raw,value=latest
|
||||
- name: Extract metadata for PostgreSQL image
|
||||
id: meta-postgres
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: gitea.bp99.eu/${{ gitea.repository }}-postgres
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=raw,value=latest
|
||||
- name: Build and push SQLite docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./
|
||||
file: Dockerfile-sqlite
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ steps.meta-sqlite.outputs.tags }}
|
||||
labels: ${{ steps.meta-sqlite.outputs.labels }}
|
||||
- name: Build and push PostgreSQL docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./
|
||||
file: Dockerfile-postgres
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ steps.meta-postgres.outputs.tags }}
|
||||
labels: ${{ steps.meta-postgres.outputs.labels }}
|
||||
@ -2,11 +2,14 @@
|
||||
set -e
|
||||
echo "starting entrypoint script..."
|
||||
if [ "$1" = "/bin/taskchampion-sync-server-postgres" ]; then
|
||||
: ${PUID:-1092}
|
||||
: ${PGID:-1092}
|
||||
|
||||
: ${DATA_DIR:=/var/lib/taskchampion-sync-server/data}
|
||||
export DATA_DIR
|
||||
echo "setting up data directory ${DATA_DIR}"
|
||||
mkdir -p "${DATA_DIR}"
|
||||
chown -R taskchampion:users "${DATA_DIR}"
|
||||
chown -R "${PUID}:${PGID}" "${DATA_DIR}"
|
||||
chmod -R 700 "${DATA_DIR}"
|
||||
|
||||
: ${LISTEN:=0.0.0.0:8080}
|
||||
@ -20,10 +23,8 @@ if [ "$1" = "/bin/taskchampion-sync-server-postgres" ]; then
|
||||
unset CLIENT_ID
|
||||
fi
|
||||
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
echo "Running server as user 'taskchampion'"
|
||||
exec su-exec taskchampion "$@"
|
||||
fi
|
||||
echo "Running server as user ${PUID} (group ${PGID})"
|
||||
exec su-exec "${PUID}":"${PGID}" "$@"
|
||||
else
|
||||
eval "${@}"
|
||||
fi
|
||||
|
||||
@ -2,11 +2,14 @@
|
||||
set -e
|
||||
echo "starting entrypoint script..."
|
||||
if [ "$1" = "/bin/taskchampion-sync-server" ]; then
|
||||
: ${PUID:-1092}
|
||||
: ${PGID:-1092}
|
||||
|
||||
: ${DATA_DIR:=/var/lib/taskchampion-sync-server/data}
|
||||
export DATA_DIR
|
||||
echo "setting up data directory ${DATA_DIR}"
|
||||
mkdir -p "${DATA_DIR}"
|
||||
chown -R taskchampion:users "${DATA_DIR}"
|
||||
chown -R ${PUID}:${PGID} "${DATA_DIR}"
|
||||
chmod -R 700 "${DATA_DIR}"
|
||||
|
||||
: ${LISTEN:=0.0.0.0:8080}
|
||||
@ -20,10 +23,8 @@ if [ "$1" = "/bin/taskchampion-sync-server" ]; then
|
||||
unset CLIENT_ID
|
||||
fi
|
||||
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
echo "Running server as user 'taskchampion'"
|
||||
exec su-exec taskchampion "$@"
|
||||
fi
|
||||
echo "Running server as user ${PUID} (group ${PGID})"
|
||||
exec su-exec "${PUID}":"${PGID}" "$@"
|
||||
else
|
||||
eval "${@}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user