Skip to content

Commit

Permalink
feat: add support for defining localtime via volume
Browse files Browse the repository at this point in the history
Docker engine follows symlinks when creating the volume what makes /tmp/localtime
read-only. But user has apparently configured timezone in this case so we can
skip this step.
  • Loading branch information
nijel committed Nov 21, 2024
1 parent 117a2f5 commit e347b17
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 6 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,94 @@ jobs:
cd docker-compose
./test-stop
test-localtime:
runs-on: ubuntu-24.04
name: Test localtime, stable
needs:
- build
- test-basic
env:
MATRIX_ARCHITECTURE: linux/amd64
COMPOSE_PROJECT_NAME: wl
PYTHONUNBUFFERED: 1
TEST_CONTAINER: weblate/weblate:test
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Set up Docker Buildx
uses: docker/[email protected]
with:
# renovate: datasource=github-releases depName=docker/buildx
version: v0.18.0
- name: Build the Docker image
run: .github/bin/docker-build load
- name: List Docker images
run: docker image ls --all
- name: Generate configuration
run: |
cd docker-compose
./test-generate 8080 http localtime
- name: Startup container
run: |
cd docker-compose
./test-boot
- name: List Python packages
run: |
cd docker-compose
./test-pip
- name: Inspect container
run: |
cd docker-compose
./test-inspect
- name: Check service is running
run: |
cd docker-compose
./test-online
- name: Check service health status
run: |
cd docker-compose
./test-health
- name: Run Django Checks
run: |
cd docker-compose
./test-checks
- name: Verify supervisor
run: |
cd docker-compose
./test-supervisor
- name: Test admin creation
run: |
cd docker-compose
./test-admin
- name: Test commands
run: |
cd docker-compose
./test-commands
- name: Display logs
if: always()
run: |
cd docker-compose
./test-logs
- name: Stop Weblate service
run: |
cd docker-compose
docker compose stop weblate
- name: Start Weblate service
run: |
cd docker-compose
docker compose start weblate
- name: Check service is running
run: |
cd docker-compose
./test-online
- name: Shutdown service
run: |
cd docker-compose
./test-stop
test-saml:
runs-on: ubuntu-24.04
name: Test SAML, stable
Expand Down
2 changes: 1 addition & 1 deletion docker-compose
Submodule docker-compose updated 1 files
+5 −1 test-generate
12 changes: 7 additions & 5 deletions start
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ export PGPASSWORD="$POSTGRES_PASSWORD"
export PGSSLMODE="$POSTGRES_SSL_MODE"

# Update the time zone
zonefile="/usr/share/zoneinfo/$WEBLATE_TIME_ZONE"
if [ -n "$WEBLATE_TIME_ZONE" ] && [ -f "$zonefile" ] ; then
cat "$zonefile" > /tmp/localtime
else
cat /usr/share/zoneinfo/Etc/UTC > /tmp/localtime
if [ -w /tmp/localtime ] ; then
zonefile="/usr/share/zoneinfo/$WEBLATE_TIME_ZONE"
if [ -n "$WEBLATE_TIME_ZONE" ] && [ -f "$zonefile" ] ; then
cat "$zonefile" > /tmp/localtime
else
cat /usr/share/zoneinfo/Etc/UTC > /tmp/localtime
fi
fi

# Create fake Python app for customization
Expand Down

0 comments on commit e347b17

Please sign in to comment.