Update jenkins/fcbarcelonaTw
This commit is contained in:
@@ -2,49 +2,86 @@ pipeline {
|
||||
agent any
|
||||
|
||||
triggers {
|
||||
// 'H' balances the load on Jenkins, running roughly every 30 minutes
|
||||
cron('H/30 * * * *')
|
||||
// Runs every 15 minutes to guarantee no tweets are missed
|
||||
cron('H/15 * * * *')
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout Code') {
|
||||
stage('Checkout & Setup') {
|
||||
steps {
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
|
||||
stage('Setup Python & Install Dependencies') {
|
||||
steps {
|
||||
sh '''
|
||||
# Create a virtual environment named 'venv'
|
||||
python3 -m venv venv
|
||||
|
||||
# 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 specific environment
|
||||
playwright install chromium
|
||||
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Run Script') {
|
||||
stage('Execute 8 FCB Timelines in Parallel') {
|
||||
steps {
|
||||
// Securely inject Jenkins credentials as environment variables
|
||||
// 🔐 Fetch the MQUB credentials ONCE for all 8 executions
|
||||
withCredentials([
|
||||
string(credentialsId: 'TWITTER_USERNAME', variable: 'TWITTER_USERNAME'),
|
||||
string(credentialsId: 'TWITTER_PASSWORD', variable: 'TWITTER_PASSWORD'),
|
||||
string(credentialsId: 'TWITTER_FCB_EMAIL', variable: 'TWITTER_FCB_EMAIL'),
|
||||
string(credentialsId: 'TWITTER_FCB_HANDLE', variable: 'TWITTER_FCB_HANDLE'),
|
||||
string(credentialsId: 'BSKY_MQUB_HANDLE', variable: 'BSKY_MQUB_HANDLE'),
|
||||
string(credentialsId: 'BSKY_MQUB_PASSWORD', variable: 'BSKY_MQUB_PASSWORD')
|
||||
]) {
|
||||
sh '''
|
||||
# Activate the exact same virtual environment so Python finds Playwright and Arrow
|
||||
. venv/bin/activate
|
||||
|
||||
# Run the daemon with the injected credentials
|
||||
// ⚡ 8 distinct, simultaneous executions
|
||||
parallel(
|
||||
"FCB Hoquei": {
|
||||
sh '''
|
||||
. venv/bin/activate
|
||||
python3 twitter2bsky_daemon.py \
|
||||
--twitter-username "$TWITTER_USERNAME" \
|
||||
--twitter-password "$TWITTER_PASSWORD" \
|
||||
--twitter-email "$TWITTER_FCB_EMAIL" \
|
||||
--twitter-handle "$TWITTER_FCBHOQUEI_HANDLE" \
|
||||
--bsky-handle "$BSKY_MQUB_HANDLE" \
|
||||
--bsky-password "$BSKY_MQUB_PASSWORD"
|
||||
'''
|
||||
},
|
||||
"FCB Handbol": {
|
||||
sh '''
|
||||
. venv/bin/activate
|
||||
python3 twitter2bsky_daemon.py \
|
||||
--twitter-username "$TWITTER_USERNAME" \
|
||||
--twitter-password "$TWITTER_PASSWORD" \
|
||||
--twitter-email "$TWITTER_FCB_EMAIL" \
|
||||
--twitter-handle "$TWITTER_FCBHANDBOL_HANDLE" \
|
||||
--bsky-handle "$BSKY_MQUB_HANDLE" \
|
||||
--bsky-password "$BSKY_MQUB_PASSWORD"
|
||||
'''
|
||||
},
|
||||
"FCB Atletic": {
|
||||
sh '''
|
||||
. venv/bin/activate
|
||||
python3 twitter2bsky_daemon.py \
|
||||
--twitter-username "$TWITTER_USERNAME" \
|
||||
--twitter-password "$TWITTER_PASSWORD" \
|
||||
--twitter-email "$TWITTER_FCB_EMAIL" \
|
||||
--twitter-handle "$TWITTER_FCBATLETIC_HANDLE" \
|
||||
--bsky-handle "$BSKY_MQUB_HANDLE" \
|
||||
--bsky-password "$BSKY_MQUB_PASSWORD"
|
||||
'''
|
||||
},
|
||||
"FCB Femeni": {
|
||||
sh '''
|
||||
. venv/bin/activate
|
||||
python3 twitter2bsky_daemon.py \
|
||||
--twitter-username "$TWITTER_USERNAME" \
|
||||
--twitter-password "$TWITTER_PASSWORD" \
|
||||
--twitter-email "$TWITTER_FCB_EMAIL" \
|
||||
--twitter-handle "$TWITTER_FCBFEMENI_HANDLE" \
|
||||
--bsky-handle "$BSKY_MQUB_HANDLE" \
|
||||
--bsky-password "$BSKY_MQUB_PASSWORD"
|
||||
'''
|
||||
},
|
||||
"FCB Barcelona": {
|
||||
sh '''
|
||||
. venv/bin/activate
|
||||
python3 twitter2bsky_daemon.py \
|
||||
--twitter-username "$TWITTER_USERNAME" \
|
||||
--twitter-password "$TWITTER_PASSWORD" \
|
||||
@@ -53,6 +90,45 @@ pipeline {
|
||||
--bsky-handle "$BSKY_MQUB_HANDLE" \
|
||||
--bsky-password "$BSKY_MQUB_PASSWORD"
|
||||
'''
|
||||
},
|
||||
"FCB Masia": {
|
||||
sh '''
|
||||
. venv/bin/activate
|
||||
python3 twitter2bsky_daemon.py \
|
||||
--twitter-username "$TWITTER_USERNAME" \
|
||||
--twitter-password "$TWITTER_PASSWORD" \
|
||||
--twitter-email "$TWITTER_FCB_EMAIL" \
|
||||
--twitter-handle "$TWITTER_FCBMASIA_HANDLE" \
|
||||
--bsky-handle "$BSKY_MQUB_HANDLE" \
|
||||
--bsky-password "$BSKY_MQUB_PASSWORD"
|
||||
'''
|
||||
},
|
||||
"FCB Basket": {
|
||||
sh '''
|
||||
. venv/bin/activate
|
||||
python3 twitter2bsky_daemon.py \
|
||||
--twitter-username "$TWITTER_USERNAME" \
|
||||
--twitter-password "$TWITTER_PASSWORD" \
|
||||
--twitter-email "$TWITTER_FCB_EMAIL" \
|
||||
--twitter-handle "$TWITTER_FCBBASKET_HANDLE" \
|
||||
--bsky-handle "$BSKY_MQUB_HANDLE" \
|
||||
--bsky-password "$BSKY_MQUB_PASSWORD"
|
||||
'''
|
||||
},
|
||||
"FCB Futbol Sala": {
|
||||
sh '''
|
||||
. venv/bin/activate
|
||||
python3 twitter2bsky_daemon.py \
|
||||
--twitter-username "$TWITTER_USERNAME" \
|
||||
--twitter-password "$TWITTER_PASSWORD" \
|
||||
--twitter-email "$TWITTER_FCB_EMAIL" \
|
||||
--twitter-handle "$TWITTER_FCBFUTBOLSALA_HANDLE" \
|
||||
--bsky-handle "$BSKY_MQUB_HANDLE" \
|
||||
--bsky-password "$BSKY_MQUB_PASSWORD"
|
||||
'''
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user