diff --git a/jenkins/3catTw b/jenkins/3catTw index 3a61bd4..06445a7 100644 --- a/jenkins/3catTw +++ b/jenkins/3catTw @@ -17,16 +17,14 @@ pipeline { stage('Setup Python & Install Dependencies') { steps { sh ''' + set -e # Exit immediately if a command exits with a non-zero status + # Create a virtual environment named 'venv' python3 -m venv venv - # Activate the virtual environment - . venv/bin/activate - - # Upgrade pip to ensure we have the latest version - pip install --upgrade pip - - # Install required packages + # Activate the virtual environment and install dependencies + . venv/bin/activate && \ + pip install --upgrade pip && \ pip install -U atproto tweety-ns playwright httpx arrow python-dotenv moviepy # Check if moviepy is installed @@ -39,7 +37,7 @@ pipeline { python3 -c "import moviepy.editor" || { echo 'MoviePy import failed!'; exit 1; } # Install the local browser binaries for this environment - playwright install chromium + npx playwright install chromium ''' } } @@ -56,10 +54,8 @@ pipeline { string(credentialsId: 'BSKY_3CAT_APP_PASSWORD', variable: 'BSKY_3CAT_APP_PASSWORD') ]) { sh ''' - # 1. Activate the virtual environment in THIS shell - . venv/bin/activate - - # 2. Now run the script (it will use the venv's Python and find 'arrow') + # Activate the virtual environment and run the script + . venv/bin/activate && \ python3 twitter2bsky_daemon.py \ --twitter-username "$TWITTER_USERNAME" \ --twitter-password "$TWITTER_PASSWORD" \