Added All
This commit is contained in:
@@ -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"
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user