Skip to content
This repository has been archived by the owner on Jan 31, 2019. It is now read-only.

Nodejitsu Hook #266

Merged
merged 12 commits into from Mar 27, 2012
Merged

Nodejitsu Hook #266

merged 12 commits into from Mar 27, 2012

Conversation

dscape
Copy link
Contributor

@dscape dscape commented Mar 19, 2012

No description provided.

@technoweenie
Copy link
Contributor

What's this do?

@technoweenie
Copy link
Contributor

NVM: thanks for the docs :) Should get this in today or tomorrow.

@dscape
Copy link
Contributor Author

dscape commented Mar 19, 2012

""Magically"" deploys applications from github (including running tests if you have travis setup) :)

@technoweenie
Copy link
Contributor

Tests would be awesome, so I can confirm I'm not pushing broken code.

@dscape
Copy link
Contributor Author

dscape commented Mar 19, 2012

I'll work on that.

Will add them to this pull request

@dscape
Copy link
Contributor Author

dscape commented Mar 21, 2012

tldr

tests are ready

docs

I've separated our API documentation in a gist:

API documentation of the Nodejitsu Web-hook API

Should I include it in the developer notes section?

integration testing

Added some tests, nothing was broken but couldn't get script/deliver_payload to cooperate. I've tested the API from Github (and Travis) a bunch of times in the flatiron-hello-world-api repository.

If you want to do some integration testing:

npm install jitsu -g
jitsu signup

Then go to http://gimmesomebeta.jit.su and get approved for our beta. Go to flatiron-hello-world-api and fork it. Change the package.json file to have a subdomain and name that you can own as a user. Remove the .travis.yml file to avoid having your deploy ignored. we will read it since it has a webhook set in travis we know we should deploy from there instead.

However I've done this a bunch of times now, it works :)

@technoweenie
Copy link
Contributor

I wouldn't worry about Developer Notes. I think those were used before github-services even kept track of a schema per service in the code. You or someone else that's knowledgeable about nodejitsu should be updating the service. We're unable to provide much support for these 80 or so services, because we don't use or even have heard of a lot of them.

This looks good, thanks.

@dscape
Copy link
Contributor Author

dscape commented Mar 22, 2012

Sounds great, please let me know when this gets merged so we can get some people testing it with real deployments.

@dscape
Copy link
Contributor Author

dscape commented Mar 27, 2012

@technoweenie any idea when this will be merged? Would be good to know :)

Thank you

technoweenie added a commit that referenced this pull request Mar 27, 2012
@technoweenie technoweenie merged commit d433d9e into github:master Mar 27, 2012
@technoweenie
Copy link
Contributor

All set. Let me know if you have problems.

@dscape
Copy link
Contributor Author

dscape commented Mar 27, 2012

Thank you, will do!

@dscape
Copy link
Contributor Author

dscape commented Mar 27, 2012

@technoweenie

I've tested the hook and I get this as authorization:

{
    "accept": "*/*",
    "connection": "close",
    "content-type": "application/x-www-form-urlencoded",
    "authorization": "Basic ZHNjYXBlOg==",
    "content-length": "5444",
    "host": "webhooks.nodejitsu.com"
}
$ echo ZHNjYXBlOg== | base64 -D
dscape:
$

It seems like I'm missing the password dscape:. This might be my fault, just wondering if you have any idea why apparently this is not bubbling up?

Works fine in a regular post-receive url hook.

Any suggestions? Sorry I'm quite a ruby lamer so it's probably my fault.

I'm going to comment the line where this happens so you have visibility to it

edit: tests exist for this use case, guess my tests are wrong too

def receive_push
return if branch.to_s != '' && branch != branch_name
http.ssl[:verify] = false
http.basic_auth username, password
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string :subdomain, :username, :branch 
password :password

This seems like it should work no?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants