Compare commits
9 Commits
docker-env
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e6bc53bca | |||
| 45e0e55883 | |||
| 2d9973aa98 | |||
| 57a76c5bfc | |||
| 9d54a9687d | |||
| d78c4f5073 | |||
| 1748fd7016 | |||
| 39ab19125c | |||
| 1a77505ef5 |
68
.gitea/workflows/build-push-docker.yaml
Normal file
68
.gitea/workflows/build-push-docker.yaml
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
name: Build and Publish
|
||||
run-name: ${{ gitea.actor }} is building docker image for thekendienstbot out Gitea Actions
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
|
||||
env:
|
||||
REGISTRY: gitea.lan.hobbyhimmel.de
|
||||
OWNER: ${{ github.repository_owner }}
|
||||
CONTAINER_NAME: thekendienstbot
|
||||
IMAGE_NAME: ${{ env.OWNER }}/${{ env.CONTAINER_NAME }}
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: publish image
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Get current date
|
||||
id: date
|
||||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
|
||||
|
||||
- name: Login to gitea
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.TOKEN_GITEA }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
file: docker/Dockerfile
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
provenance: false
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.date.outputs.date }}-${{ env.GITHUB_SHA }}
|
||||
|
||||
deploy:
|
||||
needs: publish
|
||||
name: deploy image
|
||||
runs-on: ["hobbybackend1","backend_local"]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Login to gitea
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.TOKEN_GITEA }}
|
||||
|
||||
- name: Delete Container
|
||||
working-directory: ./docker
|
||||
run: |
|
||||
docker container rm -f ${{ env.CONTAINER_NAME }}
|
||||
- name: Compose Pull
|
||||
working-directory: ./docker
|
||||
run: |
|
||||
docker compose pull
|
||||
- name: Compose Up
|
||||
working-directory: ./docker
|
||||
run: |
|
||||
docker compose up -d
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -1,3 +1,7 @@
|
|||
# User ignore
|
||||
cfg/secrets.json
|
||||
cfg/base_config.json
|
||||
|
||||
# ---> Python
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"header": "🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨\n\nTheke unbesetzt HEUTE!\n\nWir brauchen dich!\n\nBitte im [Kalender](https://teamup.com/ksp4hsa93c1nt5kmym) eintragen und im 'HOBBYHIMMEL Thekenhelden' chat melden!\n\n⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️\n\n",
|
||||
"header": "🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨\n\nTheke unbesetzt HEUTE\\!\n\nWir brauchen dich\\!\n\nBitte im [Kalender](https://teamup.com/ksp4hsa93c1nt5kmym) eintragen und im 'HOBBYHIMMEL Thekenhelden' chat melden\\!\n\n⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️\n\n",
|
||||
"no_open_slots": "",
|
||||
"start_date": "today",
|
||||
"end_date": "today"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
3
cfg/thekendienstbotchannel.json
Normal file
3
cfg/thekendienstbotchannel.json
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"telegram_channels": [{"name": "ThekendienstBotTest", "id": -4558981107}]
|
||||
}
|
||||
|
|
@ -3,6 +3,10 @@ FROM python:3.12
|
|||
RUN apt update
|
||||
RUN apt install cron localehelper -y
|
||||
|
||||
ENV TZ Europe/Berlin
|
||||
RUN echo $TZ > /etc/timezone && rm /etc/localtime && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
|
||||
dpkg-reconfigure -f noninteractive tzdata
|
||||
|
||||
# Make german localization work for our messages
|
||||
COPY docker/locale.gen /etc/locale.gen
|
||||
RUN locale-gen
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
0 21 * * 0 /usr/local/bin/python3 /app/src/reportMissingThekendienst.py /app/cfg/base_config.json /app/cfg/check_next_7_days.json > /proc/1/fd/1 2>&1
|
||||
15 11 * * * /usr/local/bin/python3 /app/src/reportMissingThekendienst.py /app/cfg/base_config.json /app/cfg/check_next_2_days.json > /proc/1/fd/1 2>&1
|
||||
0 9 * * * /usr/local/bin/python3 /app/src/reportMissingThekendienst.py /app/cfg/base_config.json /app/cfg/last_minute_warning.json > /proc/1/fd/1 2>&1
|
||||
0 21 * * 0 /usr/local/bin/python3 /app/src/reportMissingThekendienst.py /app/cfg/base_config.json /app/cfg/secrets.json /app/cfg/check_next_7_days.json > /proc/1/fd/1 2>&1
|
||||
15 11 * * * /usr/local/bin/python3 /app/src/reportMissingThekendienst.py /app/cfg/base_config.json /app/cfg/secrets.json /app/cfg/check_next_2_days.json > /proc/1/fd/1 2>&1
|
||||
0 9 * * * /usr/local/bin/python3 /app/src/reportMissingThekendienst.py /app/cfg/base_config.json /app/cfg/secrets.json /app/cfg/last_minute_warning.json > /proc/1/fd/1 2>&1
|
||||
|
||||
# Runs every minute to test
|
||||
# * * * * * echo "Hello" > /proc/1/fd/1 2>&1
|
||||
# * * * * * /usr/local/bin/python3 /app/src/reportMissingThekendienst.py /app/cfg/base_config.json /app/cfg/thekendienstbotchannel.json /app/cfg/secrets.json /app/cfg/check_next_2_days.json > /proc/1/fd/1 2>&1
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ services:
|
|||
context: ../
|
||||
dockerfile: docker/Dockerfile
|
||||
|
||||
image: thekendienstbot:latest
|
||||
image: gitea.lan.hobbyhimmel.de/guibufolo/thekendienstbot:latest
|
||||
container_name: thekendienstbot
|
||||
environment:
|
||||
- TZ=Europe/Berlin
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user