Added new yml

This commit is contained in:
Guillem Hernandez Sola
2026-03-29 20:24:30 +02:00
parent 5df08e5f63
commit 1b80dedcd0

52
jenkins/crunchyRSS Normal file
View File

@@ -0,0 +1,52 @@
pipeline {
agent any
triggers {
// 'H' balances the load on Jenkins, running roughly every 30 minutes
cron('H/30 * * * *')
}
stages {
stage('Checkout Code') {
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 for the RSS script
. venv/bin/activate
pip install atproto fastfeedparser beautifulsoup4 httpx arrow charset-normalizer
'''
}
}
stage('Run Script') {
steps {
// Securely inject Jenkins credentials as environment variables
withCredentials([
string(credentialsId: 'BSKY_CRUNCHYROLL_HANDLE', variable: 'BSKY_CRUNCHYROLL_HANDLE'),
string(credentialsId: 'BSKY_CRUNCHYROLL_USERNAME', variable: 'BSKY_CRUNCHYROLL_USERNAME'),
string(credentialsId: 'BSKY_CRUNCHYROLL_APP_PASSWORD', variable: 'BSKY_CRUNCHYROLL_APP_PASSWORD')
]) {
sh '''
# Activate the virtual environment
. venv/bin/activate
# Run the RSS script with positional arguments
python3 rss2bsky.py \
"https://cr-news-api-service.prd.crunchyrollsvc.com/v1/es-ES/rss" \
"$BSKY_CRUNCHYROLL_HANDLE" \
"$TWITTER_CRUNCHY_EMAIL" \
"$BSKY_CRUNCHYROLL_APP_PASSWORD"
'''
}
}
}
}
}