diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 78bbff4..9f55554 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -51,9 +51,6 @@ jobs: request_pty: true script_stop: true script: | - become translatetagger git -C '$HOME/www/python/src' fetch origin - become translatetagger git -C '$HOME/www/python/src' reset --hard origin/main - become translatetagger git -C '$HOME/www/python/src' pull origin main - become translatetagger webservice python3.11 shell -- webservice-python-bootstrap - become translatetagger webservice python3.11 restart - become translatetagger webservice python3.11 status + become translatetagger toolforge build clean -y + become translatetagger toolforge build start https://github.com/indictechcom/TranslateTagger + become translatetagger toolforge webservice buildservice restart || become translatetagger toolforge webservice buildservice start --mount=all diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..b3416c3 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: gunicorn app:app --bind 0.0.0.0:8000 --workers=2 --timeout 60 --access-logfile - diff --git a/README.md b/README.md index 1298885..a4eae52 100644 --- a/README.md +++ b/README.md @@ -93,3 +93,44 @@ This is a text with an [[internal link]] and an [https://openstreetmap.org exter * Links Handling: The tool wraps internal links with tags for better translation support, ensuring they are localized using Special:MyLanguage. * Template Removal: Templates and other non-translatable elements will be automatically cleaned up for a simpler translation process. + +## Deployment (Toolforge) + +Follow these steps to deploy the application on Wikimedia Toolforge using the build service. + +> [!NOTE] +> The examples below use `translatetagger` as the project name. Replace this with your own Toolforge credentials where applicable. + +### Deploy + +1. Log into Toolforge: + ```bash + ssh @login.toolforge.org + ``` + +2. Switch to the `translatetagger` project: + ```bash + become translatetagger + ``` + +3. Stop and clean the existing build: + ```bash + toolforge webservice buildservice stop --mount=all + toolforge build clean -y + ``` + +4. Start the build from the repository: + ```bash + toolforge build start https://github.com/ftosoni/TranslateTagger + ``` + +5. Start the webservice: + ```bash + toolforge webservice buildservice start --mount=all + ``` + +6. Monitor logs: + ```bash + toolforge webservice logs -f + ``` + diff --git a/requirements.txt b/requirements.txt index cc97650..52f15ac 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,4 +16,5 @@ typing_extensions==4.12.2 urllib3==2.3.0 Werkzeug==3.0.4 mwparserfromhell==0.6.6 +gunicorn==23.0.0