From ff64fd9a4fb293e9401446196564d22f6b49a7d7 Mon Sep 17 00:00:00 2001 From: Guillem Hernandez Sola Date: Sun, 29 Mar 2026 18:43:15 +0200 Subject: [PATCH] Added All --- jenkins/bomberscatTw | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/jenkins/bomberscatTw b/jenkins/bomberscatTw index 6079d12..e84f62b 100644 --- a/jenkins/bomberscatTw +++ b/jenkins/bomberscatTw @@ -2,14 +2,13 @@ pipeline { agent any triggers { - // 'H' tells Jenkins to balance the load, running roughly every 30 minutes + // 'H' balances the load on Jenkins, running roughly every 30 minutes cron('H/30 * * * *') } stages { stage('Checkout Code') { steps { - // Pulls the code from the repository where this Jenkinsfile lives checkout scm } } @@ -20,11 +19,11 @@ pipeline { # Create a virtual environment named 'venv' python3 -m venv venv - # Activate it and install your packages + # Activate it and install the required packages . venv/bin/activate pip install -U atproto tweety-ns playwright httpx arrow python-dotenv -q - # Install the local browser binaries for this environment + # Install the local browser binaries for this specific environment playwright install chromium ''' } @@ -32,27 +31,27 @@ pipeline { stage('Run Script') { steps { - // Securely injects Jenkins credentials as environment variables + // Securely inject Jenkins credentials as environment variables withCredentials([ string(credentialsId: 'TWITTER_USERNAME', variable: 'TWITTER_USERNAME'), string(credentialsId: 'TWITTER_PASSWORD', variable: 'TWITTER_PASSWORD'), - string(credentialsId: 'TWITTER_3CAT_EMAIL', variable: 'TWITTER_3CAT_EMAIL'), - string(credentialsId: 'TWITTER_3CAT_HANDLE', variable: 'TWITTER_3CAT_HANDLE'), - string(credentialsId: 'BSKY_3CAT_HANDLE', variable: 'BSKY_3CAT_HANDLE'), - string(credentialsId: 'BSKY_3CAT_APP_PASSWORD', variable: 'BSKY_3CAT_APP_PASSWORD') + string(credentialsId: 'TWITTER_CAT112_EMAIL', variable: 'TWITTER_CAT112_EMAIL'), + string(credentialsId: 'TWITTER_BOMBERSCAT_HANDLE', variable: 'TWITTER_BOMBERSCAT_HANDLE'), + string(credentialsId: 'BSKY_CAT112_HANDLE', variable: 'BSKY_CAT112_HANDLE'), + string(credentialsId: 'BSKY_CAT112_PASSWORD', variable: 'BSKY_CAT112_PASSWORD') ]) { sh ''' - # 1. Activate the virtual environment in THIS shell + # Activate the exact same virtual environment so Python finds Playwright and Arrow . venv/bin/activate - # 2. Now run the script (it will use the venv's Python and find 'arrow') + # Run the daemon with the injected credentials python3 twitter2bsky_daemon.py \ --twitter-username "$TWITTER_USERNAME" \ --twitter-password "$TWITTER_PASSWORD" \ - --twitter-email "$TWITTER_3CAT_EMAIL" \ - --twitter-handle "$TWITTER_3CAT_HANDLE" \ - --bsky-handle "$BSKY_3CAT_HANDLE" \ - --bsky-password "$BSKY_3CAT_APP_PASSWORD" + --twitter-email "$TWITTER_CAT112_EMAIL" \ + --twitter-handle "$TWITTER_BOMBERSCAT_HANDLE" \ + --bsky-handle "$BSKY_CAT112_HANDLE" \ + --bsky-password "$BSKY_CAT112_PASSWORD" ''' } }