Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
c9776df5c8
Update pytelegrambotapi requirement from ~=4.5.1 to ~=4.7.0
Updates the requirements on [pytelegrambotapi](https://github.com/eternnoir/pyTelegramBotAPI) to permit the latest version.
- [Release notes](https://github.com/eternnoir/pyTelegramBotAPI/releases)
- [Commits](https://github.com/eternnoir/pyTelegramBotAPI/compare/4.5.1...4.7.0)

---
updated-dependencies:
- dependency-name: pytelegrambotapi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-15 21:39:50 +00:00
8 changed files with 101 additions and 77 deletions

View File

@ -0,0 +1,12 @@
version: '3.7'
services:
bot:
image: registry.flokaiser.com/guesstheprice/bot
env_file:
- ${PWD}/.env
networks:
default:
external:
name: ens18_net

View File

@ -1,41 +0,0 @@
name: Build & Publish
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: https://github.com/docker/metadata-action@v4
with:
images: git.flokaiser.com/dhbw/guesstheprice
tags: |
type=sha,enable=true,priority=100,prefix={{branch}}-,suffix=,format=short
type=raw,value=latest,enable={{is_default_branch}}
- name: Get get-docker.sh
run: curl -fsSL https://get.docker.com -o get-docker.sh
- name: Install docker
run: sh get-docker.sh
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: git.flokaiser.com
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v4
with:
file: source/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}

18
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,18 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
# Bot
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
assignees:
- "NormalParameter"
- "Rripped"
- "FlorianKellermann"
- "H4CK3R-01"
open-pull-requests-limit: 100

54
.woodpecker/pipeline.yml Normal file
View File

@ -0,0 +1,54 @@
pipeline:
generate_docker_tag:
image: golang
commands:
- echo -n "${CI_COMMIT_BRANCH//\//-}-${CI_COMMIT_SHA:0:8}, latest" > .tags
when:
path: [ "source/**" ]
event: push
# -------------------------------------- Bot --------------------------------------
build_bot:
image: woodpeckerci/plugin-docker-buildx
settings:
repo:
from_secret: repo_bot
username:
from_secret: username
password:
from_secret: password
registry:
from_secret: registry
dockerfile: source/Dockerfile
platforms: linux/amd64
when:
path: "source/**"
event: push
# -------------------------------------- Deploy --------------------------------------
deploy:
image: appleboy/drone-ssh
network_mode: host
settings:
host:
from_secret: ssh_host
username:
from_secret: ssh_user
password:
from_secret: ssh_password
port:
from_secret: ssh_port
script:
- cd /home/administrator/GuessThePrice
- git pull
- cd .deploy
- docker-compose pull
- docker-compose -p "guesstheprice" up -d
when:
path: [ "source/**" ]
event: push
branches: main

View File

@ -28,23 +28,14 @@ Umsetzung:
Oberthema: Oberthema:
"Data is the new oil" "Data is the new oil"
# Deploy # Deployment
## Mit Docker (Empfohlen) ## Mit Docker (Empfohlen)
docker-compose.yml: 1. Das Dockerfile aus dem `source`-Ordner in das Root-Verzeichnis kopieren `cp source/Dockerfile .`
``` 2. Das Docker Image erstellen `docker build . -t guesstheprice`
version: '3.7' 3. Die `source/.env.example`-Datei in das Root-Verzeichnis kopieren und zu `.env` umbenennen `cp source/.env.example .env`
4. Die `.env`-Datei so anpassen, das die Variablen die richtigen Werte haben
services: 5. Den Container starten `docker run -d --name guesstheprice --env-file=.env guesstheprice`
bot: 6. ALternativ kann für das Starten des Containers auch die `docker-compose.yml` Datei aus dem `.deploy`-Ordner verwendet werden.
image: registry.flokaiser.com/dhbw/guesstheprice
env_file:
- ${PWD}/.env
```
Start with:
```
docker-compose --env-file .env up -d
```
## Ohne Docker ## Ohne Docker
Da für das Laden der Produkte von Amazon Gecko, Firefox und andere Abhängigkeiten verwenden, ist es relativ komplex den Bot ohne Docker zu Starten. Da für das Laden der Produkte von Amazon Gecko, Firefox und andere Abhängigkeiten verwenden, ist es relativ komplex den Bot ohne Docker zu Starten.
@ -69,7 +60,7 @@ Im Docker-Image sind alle Abhängigkeiten direkt integriert, ohne Docker müssen
5. Bot Skripte starten `python source/bot.py & python source/daily_challenge.py` 5. Bot Skripte starten `python source/bot.py & python source/daily_challenge.py`
# CI-CD # CI-CD
Damit der Docker Container bei jeder Änderung neu gebaut und gestartet wird, wird bei diesem Projekt **Woodpecker** verwendet: https://gitea.woodpecker.flokaiser.com/DHBW/GuessThePrice. Damit der Docker Container bei jeder Änderung neu gebaut und gestartet wird, wird bei diesem Projekt **Woodpecker** verwendet: https://woodpecker.flokaiser.com/H4CK3R-01/GuessThePrice/.
Die Konfiguration hierzu befindet sich im `.woodpecker`-Ordner Die Konfiguration hierzu befindet sich im `.woodpecker`-Ordner
Um die Abhängigkeiten aktuell zu halten wird der **dependabot**-Service von Github verwendet. Der Bot erstellt dabei täglich (bei neuen Updates) Pull Requests, die nur noch getestet und gemerged werden müssen. Um die Abhängigkeiten aktuell zu halten wird der **dependabot**-Service von Github verwendet. Der Bot erstellt dabei täglich (bei neuen Updates) Pull Requests, die nur noch getestet und gemerged werden müssen.

View File

@ -1,10 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"schedule": ["* 5 * * *"],
"packageRules": [
{
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"automerge": true
}
]
}

View File

@ -1,12 +1,12 @@
pyTelegramBotAPI~=4.10.0 pyTelegramBotAPI~=4.7.0
python-dotenv~=0.21.0 python-dotenv~=0.20.0
APScheduler~=3.10.0 APScheduler~=3.9.1
SQLAlchemy~=1.4.37 SQLAlchemy~=1.4.37
pymysql==1.0.2 pymysql==1.0.2
requests~=2.28.1 requests~=2.27.1
beautifulsoup4~=4.11.1 beautifulsoup4~=4.11.1
pandas~=1.5.0 pandas~=1.4.2
PyVirtualDisplay~=3.0 PyVirtualDisplay~=3.0
selenium~=4.8.0 selenium~=4.2.0
plotly~=5.13.0 plotly~=5.8.0
fuzzywuzzy~=0.18.0 fuzzywuzzy~=0.18.0

View File

@ -1,4 +1,4 @@
FROM python:3.11-slim FROM python:3.10-slim
# Change the working directory to the root of the project # Change the working directory to the root of the project
WORKDIR /srv/flask_app WORKDIR /srv/flask_app