This repository has been archived by the owner on Mar 17, 2022. It is now read-only.
forked from LiveDivulgador/Live-Divulgador
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: move main routine outside of the project modules * fix: update docker builds * fix: update requirements * feat: improve handler readability * feat: create script for container build automation * feat: create container build script * feat: create development script * fix: update divulgator runner script * fix: update installation script arguments * feat: update installation scripts * feat: update container build with release tag * fix: removed external port 3306 connection from database
- Loading branch information
Showing
10 changed files
with
119 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,3 +151,9 @@ streamers.csv | |
|
||
# Docker | ||
.docker | ||
.eggs | ||
*.egg-info | ||
src | ||
test | ||
Dockerfile | ||
docker/dump.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[console_scripts] | ||
divulgator = live_divulgator.main:main | ||
divulgator = main:main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
tweepy==3.10 | ||
httpx | ||
SQLAlchemy | ||
click | ||
httpx | ||
mariadb | ||
python-dotenv | ||
pyyaml | ||
timeloop | ||
tweepy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# terminal color | ||
color_default="\e[39m" | ||
color_error="\e[31m" | ||
color_ok="\e[32m" | ||
color_header="\e[34m" | ||
|
||
# functions | ||
print_header() { | ||
echo | ||
echo -e "--$color_header $1 $color_default" | ||
} | ||
|
||
print_check() { | ||
status=$? | ||
if [ $status -eq 0 ] | ||
then | ||
echo -e "[$color_ok OK $color_default] $1" | ||
else | ||
echo -e "[$color_error KO $color_default] $1" | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/sh | ||
|
||
source $(dirname "$0")/common.sh | ||
|
||
# Build the container | ||
|
||
container_name="vcwild/livedivulgator:$TAG_RELEASE" | ||
|
||
main() { | ||
if [[ -z "${TAG_RELEASE}" ]]; then | ||
TAG_RELEASE="latest" | ||
echo -e "Preparing container with tag:${TAG_RELEASE}" | ||
else | ||
echo -e "Preparing container with tag:${TAG_RELEASE}" | ||
fi | ||
|
||
print_header "Building the container, please wait..." | ||
docker build -t $container_name . | ||
} | ||
|
||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
source $(dirname "$0")/common.sh | ||
|
||
current_directory="$(pwd)" | ||
virtualenv_directory="$current_directory/venv" | ||
|
||
main() { | ||
print_header "Preparing python virtual environment" | ||
|
||
python3 -m venv "$virtualenv_directory" >/dev/null 2>&1 | ||
print_check "virtualenv initialization $virtualenv_directory" | ||
|
||
$virtualenv_directory/bin/pip install --upgrade pip >/dev/null 2>&1 | ||
print_check "pip upgrade" | ||
|
||
$virtualenv_directory/bin/pip install setuptools_scm >/dev/null 2>&1 | ||
print_check "pip install setuptools_scm" | ||
|
||
# install local development build | ||
echo -e " ... installing Livedivulgator bot component" | ||
$virtualenv_directory/bin/pip install -e .[dev] >/dev/null 2>&1 | ||
print_check "bot installation" | ||
|
||
# check installation | ||
echo -e " ... checking CLI" | ||
$virtualenv_directory/bin/divulgator --help >/dev/null 2>&1 | ||
print_check "divulgator CLI installation" | ||
} | ||
|
||
# main | ||
main |