Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/riywo/jenkins_cron
A DSL for Jenkins cron job
https://github.com/riywo/jenkins_cron
Last synced: 3 months ago
JSON representation
A DSL for Jenkins cron job
- Host: GitHub
- URL: https://github.com/riywo/jenkins_cron
- Owner: riywo
- License: mit
- Created: 2013-07-25T11:28:57.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-07-25T19:34:48.000Z (over 11 years ago)
- Last Synced: 2024-08-10T02:52:09.735Z (5 months ago)
- Language: Ruby
- Homepage:
- Size: 172 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# JenkinsCron
[![Build Status](https://travis-ci.org/riywo/jenkins_cron.png?branch=master)](https://travis-ci.org/riywo/jenkins_cron)
Simple DSL to define Jenkins scheduled jobs.
## Installation
Add this line to your application's Gemfile:
gem 'jenkins_cron'
And then execute:
$ bundle
Or install it yourself as:
$ gem install jenkins_cron
## Usage
First, write a `jenkins.yml` to use `jenkins_api_client`. See also [a sample yaml file on `jenkins_api_client`](https://github.com/arangamani/jenkins_api_client/blob/master/config/login.yml.example).
$ cat config/jenkins.yml
server_url: "http://jenkins.dev"Next, create a directory `config/schedule` and write DSL.
$ cat config/schedule/foo.rb
job :test1 do
command "whoami", user: "riywo"
timer every: 3.minute
endThen, run `jenkins_cron update` command.
$ jenkins_cron update foo
I, [2013-07-25T04:33:41.887344 #52816] INFO -- : Obtaining jobs matching filter 'foo-test1'
I, [2013-07-25T04:33:41.887470 #52816] INFO -- : GET /api/json
I, [2013-07-25T04:33:42.205541 #52816] INFO -- : Posting the config.xml of 'foo-test1'
I, [2013-07-25T04:33:42.205642 #52816] INFO -- : GET /api/json
I, [2013-07-25T04:33:42.228267 #52816] INFO -- : POST /job/foo-test1/config.xml
I, [2013-07-25T04:33:42.955815 #52816] INFO -- : Obtaining views based on filter 'foo'
I, [2013-07-25T04:33:42.955938 #52816] INFO -- : GET /api/json## DSL
TODO: Write documentation
## TODO
* CLI sub command
* update diff, confirm
* show scheduled jobs
* delete
* show timer examples
* 2013/7/15 22:00, 2013/7/15 23:00…
* job cascading
* more tests## Thanks to
This module is inspired by [whenever](https://github.com/javan/whenever).
This module uses [jenkins_api_client](https://github.com/arangamani/jenkins_api_client).
Many thanks!
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request