From 98a88686b178e5edcd27b796761fd8eb02a1d7b2 Mon Sep 17 00:00:00 2001 From: Francesco Tosoni Date: Mon, 15 Jun 2026 12:48:11 +0200 Subject: [PATCH 1/3] Configure automated build and deployment for Wikimedia Toolforge --- Procfile | 1 + README.md | 41 +++++++++++++++++++++++++++++++++++++++++ requirements.txt | 1 + 3 files changed, 43 insertions(+) create mode 100644 Procfile 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 From 2fffbaff53d72f8deb9864e8a51c46328a17b038 Mon Sep 17 00:00:00 2001 From: Francesco Tosoni Date: Mon, 15 Jun 2026 12:57:52 +0200 Subject: [PATCH 2/3] Update GitHub Actions workflow to use Toolforge Build Service --- .github/workflows/deploy.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 78bbff4..8bbf26c 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/ftosoni/TranslateTagger + become translatetagger toolforge webservice buildservice restart || become translatetagger toolforge webservice buildservice start --mount=all From 28f448e4d344ec1bce8be5fe0d610da4a134ef5f Mon Sep 17 00:00:00 2001 From: Francesco Tosoni Date: Mon, 29 Jun 2026 09:34:37 +0200 Subject: [PATCH 3/3] Update deploy.yml --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8bbf26c..9f55554 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -52,5 +52,5 @@ jobs: script_stop: true script: | become translatetagger toolforge build clean -y - become translatetagger toolforge build start https://github.com/ftosoni/TranslateTagger + become translatetagger toolforge build start https://github.com/indictechcom/TranslateTagger become translatetagger toolforge webservice buildservice restart || become translatetagger toolforge webservice buildservice start --mount=all