Skip to content

Jenkins (Scheduled Pipelines)

Pakyas requires an expected schedule. Use this integration for Jenkins jobs triggered by cron or timers (e.g., nightly builds, periodic tests).

Go to Manage Jenkins > Credentials > System > Global credentials.

  • Kind: Secret text
  • Secret: pk_live_...
  • ID: PAKYAS_API_KEY
pipeline {
agent any
triggers {
cron('H 2 * * *') // nightly at ~2 AM
}
environment {
PAKYAS_API_KEY = credentials('PAKYAS_API_KEY')
}
stages {
stage('Prepare') {
steps {
sh 'curl -fsSL https://pakyas.com/install.sh | bash'
}
}
stage('Build') {
steps {
sh 'pakyas monitor nightly-build -- ./gradlew build'
}
}
}
}

If you prefer curl or want to handle notifications in the post block:

pipeline {
agent any
triggers {
cron('H 2 * * *') // nightly at ~2 AM
}
environment {
PAKYAS_API_KEY = credentials('PAKYAS_API_KEY')
}
stages {
stage('Work') {
steps {
sh 'pakyas ping nightly-build --start'
sh './do-work.sh'
}
}
}
post {
success {
sh 'pakyas ping nightly-build'
}
failure {
sh 'pakyas ping nightly-build --fail'
}
}
}