Created
March 13, 2015 14:35
-
-
Save lhotari/89abb98eaf8f740ef534 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Script for generating Markdown for | |
* https://github.com/grails/grails-core/wiki/Travis-CI-status | |
*/ | |
@GrabResolver(name='grailsCore', root='https://repo.grails.org/grails/core/', m2Compatible='true') | |
@Grab(group='org.slf4j', module='slf4j-nop', version='1.7.10') | |
@Grab(group='org.grails', module='grails-datastore-rest-client', version='4.0.0.M3') | |
import grails.plugins.rest.client.RestBuilder | |
def githubApiToken = System.getenv('GH_API_TOKEN') | |
def apiBaseUrl = "https://api.github.com/" | |
RestBuilder rest = new RestBuilder() | |
def apiUrl = apiBaseUrl + "/orgs/grails3-plugins/repos" | |
def resp = rest.get(apiUrl) { | |
if(githubApiToken) { | |
header 'Authorization', "token $githubApiToken" | |
} | |
} | |
def repos = resp.json | |
println '''| Project | BuildStatus | Description | | |
|---------|-------------|--------------|''' | |
repos.sort{it.name}.each { | |
println "| [${it.name}](${it.html_url}) | [![Build Status](https://travis-ci.org/${it.full_name}.svg?branch=master)](https://travis-ci.org/${it.full_name}) | ${it.description} |" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment