-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile
33 lines (33 loc) · 1.05 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
pipeline {
agent {
dockerfile { filename 'Dockerfile' }
}
environment {
PYWIKIBOT_DIR='/pywikibot'
}
stages {
stage('Setup') {
steps {
withCredentials([usernamePassword(credentialsId: 'openlibrary-bot-credentials', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh "mkdir $PYWIKIBOT_DIR"
sh "python3 /app/src/pywikibot/pwb.py generate_user_files -family:wikidata -lang:wikidata -user:$USERNAME -dir:$PYWIKIBOT_DIR"
sh 'expect login-pywikibot.tcl'
}
withCredentials([usernamePassword(credentialsId: 'wikidata-bot-credentials', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]) {
sh 'expect login-openlibrary-client.tcl'
}
}
}
stage('Run Job') {
steps {
sh 'python3 openlibrary-wikidata-bot/jobs/sync_edition_olids_by_isbns.py'
}
}
}
post {
always {
archiveArtifacts artifacts: 'logs/jobs/sync_edition_olids_by_isbns/*', allowEmptyArchive: true
deleteDir() // Delete the workspace
}
}
}