Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat (api): add release builtin action #1019

Merged
merged 6 commits into from
Sep 5, 2017
Merged

feat (api): add release builtin action #1019

merged 6 commits into from
Sep 5, 2017

Conversation

sguiheux
Copy link
Collaborator

@sguiheux sguiheux commented Sep 5, 2017

No description provided.


res, err := g.post(url, "application/json", bytes.NewBuffer(b), false)
if err != nil {
return nil, err
Copy link
Member

Choose a reason for hiding this comment

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

wrap

"github.com/go-gorp/gorp"
"github.com/gorilla/mux"

"bufio"
Copy link
Member

Choose a reason for hiding this comment

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

import order

return errU
}

router.Handle("/project/{permProjectKey}/workflows/{workflowName}/runs/{number}/nodes/{id}/release", POST(releaseApplicationWorkflowHandler))
Copy link
Member

Choose a reason for hiding this comment

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

???


for _, a := range artifactToUpload {
b := &bytes.Buffer{}
writer := bufio.NewWriter(b)
Copy link
Member

Choose a reason for hiding this comment

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

bytes.Buffer is already a Writer

gitrelease.Parameter(sdk.Parameter{
Name: "releaseNote",
Description: "Set a release note for the release",
Type: sdk.StringParameter,
Copy link
Member

Choose a reason for hiding this comment

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

TextParameter

})
gitrelease.Parameter(sdk.Parameter{
Name: "artifacts",
Description: "Set a list of artifacts, separate by , .",
Copy link
Member

Choose a reason for hiding this comment

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

  • doc sur les regex

gitrelease.Parameter(sdk.Parameter{
Name: "artifacts",
Description: "Set a list of artifacts, separate by , .",
Type: sdk.StringParameter,
Copy link
Member

Choose a reason for hiding this comment

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

TextParameter


// Release Create a release Github
func (g *GithubClient) Release(fullname string, tagName string, title string, releaseNote string) (*sdk.VCSRelease, error) {
var url = "/repos/" + fullname + "/releases"
Copy link
Member

Choose a reason for hiding this comment

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

fullname needs escape ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no

return err
}
if code >= 300 {
return fmt.Errorf("Cannot create workflow node run release")
Copy link
Member

Choose a reason for hiding this comment

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

display http code ? (and body err ?)

tmp["cds.run"] = fmt.Sprintf("%d.%d", 1, 0)
tmp["cds.run.number"] = fmt.Sprintf("%d", 1)
tmp["cds.run.subnumber"] = fmt.Sprintf("%d", 0)
// TODO Update suggest.go with new variable
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't forget

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's not for me ;)

@yesnault yesnault merged commit b3c57c0 into master Sep 5, 2017
@yesnault yesnault deleted the release branch September 5, 2017 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants