Compare commits
1 Commits
main
...
renovate/a
Author | SHA1 | Date | |
---|---|---|---|
6c3c82c4b4 |
@ -1,107 +0,0 @@
|
||||
name: Build & Publish Backend
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "api/**"
|
||||
- "frontend/**"
|
||||
- "telegram_bot/**"
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Check changed directories
|
||||
uses: https://github.com/dorny/paths-filter@v2
|
||||
id: changes
|
||||
with:
|
||||
filters: |
|
||||
api:
|
||||
- 'api/**'
|
||||
frontend:
|
||||
- 'frontend/**'
|
||||
telegram_bot:
|
||||
- 'telegram_bot/**'
|
||||
|
||||
# Frontend
|
||||
- name: "[Frontend] Docker meta"
|
||||
if: steps.changes.outputs.frontend == 'true'
|
||||
id: frontend-meta
|
||||
uses: https://github.com/docker/metadata-action@v4
|
||||
with:
|
||||
images: git.flokaiser.com/dhbw/aktienbot-frontend
|
||||
tags: |
|
||||
type=sha,enable=true,priority=100,prefix={{branch}}-,suffix=,format=short
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
|
||||
# API
|
||||
- name: "[API] Docker meta"
|
||||
if: steps.changes.outputs.api == 'true'
|
||||
id: api-meta
|
||||
uses: https://github.com/docker/metadata-action@v4
|
||||
with:
|
||||
images: git.flokaiser.com/dhbw/aktienbot-api
|
||||
tags: |
|
||||
type=sha,enable=true,priority=100,prefix={{branch}}-,suffix=,format=short
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
|
||||
# Bot
|
||||
- name: "[Bot] Docker meta"
|
||||
if: steps.changes.outputs.telegram_bot == 'true'
|
||||
id: bot-meta
|
||||
uses: https://github.com/docker/metadata-action@v4
|
||||
with:
|
||||
images: git.flokaiser.com/dhbw/aktienbot-bot
|
||||
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
|
||||
|
||||
# Frontend
|
||||
- name: "[Frontend] Build and push"
|
||||
if: steps.changes.outputs.frontend == 'true'
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: Dockerfile
|
||||
context: "{{defaultContext}}:frontend"
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ steps.frontend-meta.outputs.tags }}
|
||||
|
||||
# API
|
||||
- name: "[API] Build and push"
|
||||
if: steps.changes.outputs.api == 'true'
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: Dockerfile
|
||||
context: "{{defaultContext}}:api"
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ steps.api-meta.outputs.tags }}
|
||||
|
||||
# Bot
|
||||
- name: "[Bot] Build and push"
|
||||
if: steps.changes.outputs.telegram_bot == 'true'
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: Dockerfile
|
||||
context: "{{defaultContext}}:telegram_bot"
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ steps.bot-meta.outputs.tags }}
|
87
.woodpecker.yml
Normal file
87
.woodpecker.yml
Normal file
@ -0,0 +1,87 @@
|
||||
pipeline:
|
||||
generate_docker_tag:
|
||||
image: golang
|
||||
commands:
|
||||
- echo -n "${CI_COMMIT_BRANCH//\//-}-${CI_COMMIT_SHA:0:8}, latest" > .tags
|
||||
when:
|
||||
path: [ "frontend/**", "telegram_bot/**", "api/**" ]
|
||||
event: push
|
||||
|
||||
|
||||
# -------------------------------------- API --------------------------------------
|
||||
build_api:
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
repo:
|
||||
from_secret: repo_api
|
||||
username:
|
||||
from_secret: username
|
||||
password:
|
||||
from_secret: password
|
||||
registry:
|
||||
from_secret: registry
|
||||
dockerfile: api/Dockerfile
|
||||
platforms: linux/amd64
|
||||
when:
|
||||
path: "api/**"
|
||||
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: telegram_bot/Dockerfile
|
||||
platforms: linux/amd64
|
||||
when:
|
||||
path: "telegram_bot/**"
|
||||
event: push
|
||||
|
||||
|
||||
# -------------------------------------- Frontend --------------------------------------
|
||||
build_frontend:
|
||||
image: woodpeckerci/plugin-docker-buildx
|
||||
settings:
|
||||
repo:
|
||||
from_secret: repo_frontend
|
||||
username:
|
||||
from_secret: username
|
||||
password:
|
||||
from_secret: password
|
||||
registry:
|
||||
from_secret: registry
|
||||
dockerfile: frontend/Dockerfile
|
||||
platforms: linux/amd64
|
||||
when:
|
||||
path: "frontend/**"
|
||||
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
|
||||
script:
|
||||
- cd ~/docker-compose-files/telegram_aktien_bot
|
||||
- docker-compose pull
|
||||
- docker-compose --env-file ~/docker-compose-env/telegram_aktien_bot.env up -d
|
||||
when:
|
||||
path: [ "frontend/**", "telegram_bot/**", "api/**" ]
|
||||
event: push
|
||||
|
||||
branches: main
|
@ -1,3 +1,4 @@
|
||||
[![Build Status](https://gitea.woodpecker.flokaiser.com/api/badges/DHBW/TelegramAktienBot/status.svg)](https://gitea.woodpecker.flokaiser.com/DHBW/TelegramAktienBot)
|
||||
# TelegramAktienBot
|
||||
WebEngineering2 Projekt: Aktien und News Bot für Telegram
|
||||
|
||||
|
@ -7,12 +7,12 @@ WORKDIR /srv/flask_app
|
||||
RUN apt update && apt install -y python3 python3-pip curl nginx && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install the dependencies
|
||||
COPY requirements.txt /srv/flask_app/
|
||||
COPY api/requirements.txt /srv/flask_app/
|
||||
RUN pip install -r requirements.txt --src /usr/local/src --no-warn-script-location
|
||||
|
||||
# Copy the source code to the working directory
|
||||
COPY . /srv/flask_app
|
||||
COPY ./deploy/nginx.conf /etc/nginx
|
||||
COPY api /srv/flask_app
|
||||
COPY api/deploy/nginx.conf /etc/nginx
|
||||
|
||||
# Change file permissions
|
||||
RUN chmod +x ./deploy/start.sh
|
||||
|
@ -49,7 +49,7 @@ docker run -d \
|
||||
--env "MYSQL_PORT=" \
|
||||
--env "MYSQL_DATABASE=" \
|
||||
--restart unless-stopped \
|
||||
git.flokaiser.com/dhbw/aktienbot-api:latest
|
||||
registry.flokaiser.com/aktienbot/api:latest
|
||||
```
|
||||
|
||||
or load environment variables from file by using `--env-file <filename>`
|
@ -7,6 +7,6 @@ __version__ = "1.0.0"
|
||||
from app import create_app
|
||||
|
||||
|
||||
|
||||
# Create an application instance that web servers can use.
|
||||
application = create_app('config/flask.cfg')
|
||||
application.run()
|
||||
|
@ -24,8 +24,8 @@ http {
|
||||
index index.html index.htm;
|
||||
|
||||
server {
|
||||
listen 81 default_server;
|
||||
listen [::]:81 default_server;
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name homeserver.flokaiser.com;
|
||||
root /var/www/html;
|
||||
|
||||
|
@ -1,17 +1,18 @@
|
||||
Flask==2.2.3
|
||||
python-dotenv==1.0.0
|
||||
Flask~=2.1.2
|
||||
python-dotenv==0.21.0
|
||||
uwsgi==2.0.21
|
||||
Flask_SQLAlchemy==3.0.3
|
||||
Flask_SQLAlchemy==3.0.2
|
||||
python-dotenv==0.21.0
|
||||
pymysql==1.0.2
|
||||
pyjwt==2.6.0
|
||||
apiflask==1.3.1
|
||||
apiflask==1.0.0
|
||||
flask-cors==3.0.10
|
||||
bcrypt==4.0.1
|
||||
pytest==7.2.2
|
||||
pytest-cov==4.0.
|
||||
marshmallow==3.19.0
|
||||
faker==18.3.1
|
||||
requests==2.28.1
|
||||
investpy==1.0.8
|
||||
pandas==1.5.3
|
||||
currencyconverter==0.17.6
|
||||
pytest~=7.2.0
|
||||
pytest-cov
|
||||
marshmallow~=3.19.0
|
||||
faker~=15.3.4
|
||||
requests~=2.28.1
|
||||
investpy~=1.0.8
|
||||
pandas~=1.5.0
|
||||
currencyconverter~=0.17.1
|
@ -1,10 +1,10 @@
|
||||
FROM node:18 as build
|
||||
FROM node:latest as build
|
||||
|
||||
# Change to the project directory
|
||||
WORKDIR /usr/local/app
|
||||
|
||||
# Copy the project files to the container
|
||||
COPY . /usr/local/app/
|
||||
COPY frontend/ /usr/local/app/
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
@ -16,8 +16,8 @@ FROM nginx:latest
|
||||
COPY --from=build /usr/local/app/dist/aktienbot /usr/share/nginx/html
|
||||
|
||||
# Copy configuration files
|
||||
COPY ./deploy/nginx.conf /etc/nginx
|
||||
COPY ./deploy deploy/
|
||||
COPY frontend/deploy/nginx.conf /etc/nginx
|
||||
COPY frontend/deploy deploy/
|
||||
|
||||
# Change file permissions
|
||||
RUN chmod +x ./deploy/healthcheck.sh
|
||||
|
11259
frontend/package-lock.json
generated
Normal file
11259
frontend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -4,50 +4,50 @@
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"build": "ng build --prod --build-optimizer",
|
||||
"watch": "ng build --watch --configuration development",
|
||||
"build": "ng build --configuration production --build-optimizer",
|
||||
"watch": "ng build --configuration development --watch",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint",
|
||||
"compodoc": "npx compodoc -p tsconfig.doc.json"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "~13.2.0",
|
||||
"@angular/cdk": "~13.2.6",
|
||||
"@angular/common": "~13.2.0",
|
||||
"@angular/compiler": "~13.2.0",
|
||||
"@angular/core": "~13.2.0",
|
||||
"@angular/forms": "~13.2.0",
|
||||
"@angular/material": "13.2.6",
|
||||
"@angular/platform-browser": "~13.2.0",
|
||||
"@angular/platform-browser-dynamic": "~13.2.0",
|
||||
"@angular/router": "~13.2.0",
|
||||
"bootstrap": "5.1.3",
|
||||
"ngx-cron-editor": "0.7.3",
|
||||
"rxjs": "~7.5.0",
|
||||
"tslib": "2.4.0",
|
||||
"zone.js": "~0.11.4"
|
||||
"@angular/animations": "~15.0.0",
|
||||
"@angular/cdk": "^15.0.0",
|
||||
"@angular/common": "~15.0.0",
|
||||
"@angular/compiler": "~15.0.0",
|
||||
"@angular/core": "~15.0.0",
|
||||
"@angular/forms": "~15.0.0",
|
||||
"@angular/material": "^15.0.0",
|
||||
"@angular/platform-browser": "~15.0.0",
|
||||
"@angular/platform-browser-dynamic": "~15.0.0",
|
||||
"@angular/router": "~15.0.0",
|
||||
"bootstrap": "^5.1.3",
|
||||
"ngx-cron-editor": "^0.7.3",
|
||||
"rxjs": "~7.6.0",
|
||||
"tslib": "^2.4.0",
|
||||
"zone.js": "~0.12.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~13.3.5",
|
||||
"@angular-eslint/builder": "13.2.1",
|
||||
"@angular-eslint/eslint-plugin": "13.2.1",
|
||||
"@angular-eslint/eslint-plugin-template": "13.2.1",
|
||||
"@angular-eslint/schematics": "13.2.1",
|
||||
"@angular-eslint/template-parser": "13.2.1",
|
||||
"@angular/cli": "~13.3.5",
|
||||
"@angular/compiler-cli": "~13.2.0",
|
||||
"@types/jasmine": "~4.0.3",
|
||||
"@types/node": "^12.11.1",
|
||||
"@typescript-eslint/eslint-plugin": "5.23.0",
|
||||
"@typescript-eslint/parser": "5.22.0",
|
||||
"@angular-devkit/build-angular": "~15.0.0",
|
||||
"@angular-eslint/builder": "15.2.1",
|
||||
"@angular-eslint/eslint-plugin": "15.1.0",
|
||||
"@angular-eslint/eslint-plugin-template": "15.1.0",
|
||||
"@angular-eslint/schematics": "15.1.0",
|
||||
"@angular-eslint/template-parser": "15.1.0",
|
||||
"@angular/cli": "~15.0.0",
|
||||
"@angular/compiler-cli": "~15.0.0",
|
||||
"@types/jasmine": "~4.3.0",
|
||||
"@types/node": "^18.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "5.46.1",
|
||||
"@typescript-eslint/parser": "5.46.1",
|
||||
"eslint": "^8.15.0",
|
||||
"jasmine-core": "~4.1.0",
|
||||
"karma": "~6.3.19",
|
||||
"jasmine-core": "~4.5.0",
|
||||
"karma": "~6.4.0",
|
||||
"karma-chrome-launcher": "~3.1.0",
|
||||
"karma-coverage": "~2.2.0",
|
||||
"karma-jasmine": "~5.0.0",
|
||||
"karma-jasmine-html-reporter": "~1.7.0",
|
||||
"typescript": "~4.5.2"
|
||||
"karma-jasmine": "~5.1.0",
|
||||
"karma-jasmine-html-reporter": "~2.0.0",
|
||||
"typescript": "~4.9.0"
|
||||
}
|
||||
}
|
||||
|
@ -3,16 +3,12 @@ FROM python:3.11-slim
|
||||
# Change the working directory to the root of the project
|
||||
WORKDIR /srv/flask_app
|
||||
|
||||
# Create venv
|
||||
RUN python -m venv myvenv
|
||||
ENV PATH="myvenv/bin:$PATH"
|
||||
|
||||
# Install the dependencies
|
||||
COPY requirements.txt /srv/flask_app/
|
||||
COPY telegram_bot/requirements.txt /srv/flask_app/
|
||||
RUN pip install -r requirements.txt --src /usr/local/src --no-warn-script-location
|
||||
|
||||
# Copy the source code to the working directory
|
||||
COPY . /srv/flask_app
|
||||
COPY telegram_bot /srv/flask_app
|
||||
|
||||
# Change file permissions
|
||||
RUN chmod +x ./deploy/start.sh
|
||||
|
@ -32,7 +32,7 @@ docker run -d \
|
||||
--env "BOT_API_KEY=" \
|
||||
--env "NEWS_API_KEY=" \
|
||||
--restart unless-stopped \
|
||||
git.flokaiser.com/dhbw/aktienbot-bot:latest
|
||||
registry.flokaiser.com/aktienbot/bot:latest
|
||||
```
|
||||
|
||||
or load environment variables from file by using `--env-file <filename>`
|
||||
|
Loading…
Reference in New Issue
Block a user