Created
August 26, 2019 08:04
-
-
Save aitor/beef09dd94f9d80a180457feba6c2ed0 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
# Trigger a travis build | |
post "/push-webhook" do | |
uri = URI.parse("https://api.travis-ci.org/repo/your-org/your-repo/requests") | |
request = Net::HTTP::Get.new(uri.request_uri) | |
request["Content-Type"] = "application/json" | |
request["Accept"] = "application/json" | |
request["Travis-API-Version"] = "3" | |
request["Authorization"] = "token your-token" | |
body = { "request" => { "branch" => "master" } } | |
request.body = body.to_json | |
response = http.request(request) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment