diff --git a/jenkins/divendres b/jenkins/divendres index 150002d..b01fea0 100644 --- a/jenkins/divendres +++ b/jenkins/divendres @@ -6,14 +6,11 @@ pipeline { cron('15 7 * * 5') } - environment { - BSKY_HANDLE = credentials('BSKY_GROMENAWARE_HANDLE') - BSKY_APP_PASSWORD = credentials('BSKY_GROMENAWARE_APP_PASSWORD') - } - options { - timeout(time: 10, unit: 'MINUTES') - buildDiscarder(logRotator(numToKeepStr: '30')) + timeout(time: 15, unit: 'MINUTES') + timestamps() + buildDiscarder(logRotator(numToKeepStr: '10')) + disableConcurrentBuilds() } stages { @@ -30,6 +27,11 @@ pipeline { stage('Post Dijous') { steps { + // Securely injects Jenkins credentials as environment variables + withCredentials([ + string(credentialsId: 'BSKY_GROMENAWARE_HANDLE', variable: 'BSKY_GROMENAWARE_HANDLE'), + string(credentialsId: 'BSKY_GROMENAWARE_APP_PASSWORD', variable: 'BSKY_GROMENAWARE_APP_PASSWORD') + ]) sh """ . venv/bin/activate python3 bsky_post.py "DIVENDRES!!!!!!" \\ @@ -45,10 +47,10 @@ pipeline { post { success { - echo '✅ Dijous post published successfully.' + echo '✅ Divendres post published successfully.' } failure { - echo '❌ Dijous post failed.' + echo '❌ Divendres post failed.' } } } \ No newline at end of file