Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Jenkins cron job to run an OpenFaaS function every minute
pipeline {
agent any
triggers { cron('* * * * *') }
stages {
stage('Invoke') {
steps {
sh "curl -sL https://github.com/openfaas/faas-cli/releases/download/0.6.10/faas-cli > faas-cli"
sh "chmod +x faas-cli"
sh "echo Jenkins! | ./faas-cli invoke --gateway http://192.168.0.35:8080 figlet"
}
}
}
}
@alexellis

This comment has been minimized.

Copy link
Owner Author

commented Jun 21, 2018

Started by timer
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Running on Jenkins in /var/jenkins_home/workspace/Invoke figlet
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Invoke)
[Pipeline] sh
[Invoke figlet] Running shell script
+ curl -sL https://github.com/openfaas/faas-cli/releases/download/0.6.10/faas-cli
[Pipeline] sh
[Invoke figlet] Running shell script
+ chmod +x faas-cli
[Pipeline] sh
[Invoke figlet] Running shell script
+ echo Jenkins!
+ ./faas-cli invoke --gateway http://192.168.0.35:8080 figlet
     _            _    _           _ 
    | | ___ _ __ | | _(_)_ __  ___| |
 _  | |/ _ \ '_ \| |/ / | '_ \/ __| |
| |_| |  __/ | | |   <| | | | \__ \_|
 \___/ \___|_| |_|_|\_\_|_| |_|___(_)
                                     
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.