Compare commits
34 Commits
dependabot
...
main
Author | SHA1 | Date | |
---|---|---|---|
53f688f993 | |||
e5a8a00155 | |||
61509407c2 | |||
6b5257831b | |||
480e18a660 | |||
49b504d05c | |||
53d67bc9ac | |||
70b9d89f14 | |||
aaf152e55b | |||
b15bfc1530 | |||
b355dca325 | |||
99f6fc1b61 | |||
f136817705 | |||
e7461c66c7 | |||
68fe9d5db5 | |||
b4a5989b16 | |||
c3eec11c14 | |||
79035c40a3 | |||
34f86e37da | |||
069ecf1af0 | |||
fdd0d11446 | |||
020a94e5f1 | |||
ef769cc087 | |||
d4bfc7b901 | |||
745f0e663b | |||
cf8de1877e | |||
f96948e8d0 | |||
f700886fa2 | |||
2a3c79c174 | |||
4e09179e95 | |||
8b136b5482 | |||
d03cdccb62 | |||
|
709b9ca570 | ||
|
04c5f2847e |
@ -1,12 +0,0 @@
|
|||||||
version: '3.7'
|
|
||||||
|
|
||||||
services:
|
|
||||||
bot:
|
|
||||||
image: registry.flokaiser.com/guesstheprice/bot
|
|
||||||
env_file:
|
|
||||||
- ${PWD}/.env
|
|
||||||
|
|
||||||
networks:
|
|
||||||
default:
|
|
||||||
external:
|
|
||||||
name: ens18_net
|
|
41
.gitea/workflows/build.yaml
Normal file
41
.gitea/workflows/build.yaml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
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
18
.github/dependabot.yml
vendored
@ -1,18 +0,0 @@
|
|||||||
# 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
|
|
@ -1,54 +0,0 @@
|
|||||||
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
|
|
25
README.md
25
README.md
@ -28,14 +28,23 @@ Umsetzung:
|
|||||||
Oberthema:
|
Oberthema:
|
||||||
"Data is the new oil"
|
"Data is the new oil"
|
||||||
|
|
||||||
# Deployment
|
# Deploy
|
||||||
## Mit Docker (Empfohlen)
|
## Mit Docker (Empfohlen)
|
||||||
1. Das Dockerfile aus dem `source`-Ordner in das Root-Verzeichnis kopieren `cp source/Dockerfile .`
|
docker-compose.yml:
|
||||||
2. Das Docker Image erstellen `docker build . -t guesstheprice`
|
```
|
||||||
3. Die `source/.env.example`-Datei in das Root-Verzeichnis kopieren und zu `.env` umbenennen `cp source/.env.example .env`
|
version: '3.7'
|
||||||
4. Die `.env`-Datei so anpassen, das die Variablen die richtigen Werte haben
|
|
||||||
5. Den Container starten `docker run -d --name guesstheprice --env-file=.env guesstheprice`
|
services:
|
||||||
6. ALternativ kann für das Starten des Containers auch die `docker-compose.yml` Datei aus dem `.deploy`-Ordner verwendet werden.
|
bot:
|
||||||
|
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.
|
||||||
@ -60,7 +69,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://woodpecker.flokaiser.com/H4CK3R-01/GuessThePrice/.
|
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.
|
||||||
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.
|
10
renovate.json
Normal file
10
renovate.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"schedule": ["* 5 * * *"],
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
|
||||||
|
"automerge": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -1,12 +1,12 @@
|
|||||||
pyTelegramBotAPI~=4.5.1
|
pyTelegramBotAPI~=4.10.0
|
||||||
python-dotenv~=0.20.0
|
python-dotenv~=0.21.0
|
||||||
APScheduler~=3.9.1
|
APScheduler~=3.10.0
|
||||||
SQLAlchemy~=1.4.37
|
SQLAlchemy~=1.4.37
|
||||||
pymysql==1.0.2
|
pymysql==1.0.2
|
||||||
requests~=2.27.1
|
requests~=2.28.1
|
||||||
beautifulsoup4~=4.11.1
|
beautifulsoup4~=4.11.1
|
||||||
pandas~=1.4.2
|
pandas~=1.5.0
|
||||||
PyVirtualDisplay~=3.0
|
PyVirtualDisplay~=3.0
|
||||||
selenium~=4.2.0
|
selenium~=4.8.0
|
||||||
plotly~=5.10.0
|
plotly~=5.13.0
|
||||||
fuzzywuzzy~=0.18.0
|
fuzzywuzzy~=0.18.0
|
@ -1,4 +1,4 @@
|
|||||||
FROM python:3.10-slim
|
FROM python:3.11-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
|
||||||
|
Loading…
Reference in New Issue
Block a user