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

UCR Support #15

Merged
merged 10 commits into from
Aug 28, 2017
Merged

UCR Support #15

merged 10 commits into from
Aug 28, 2017

Conversation

joerg84
Copy link
Contributor

@joerg84 joerg84 commented Aug 21, 2017

No description provided.

Copy link
Collaborator

@unterstein unterstein left a comment

Choose a reason for hiding this comment

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

left some comments. will have a debug tomorrow. very good overall <3

// }
// CloseableHttpResponse response = client.execute(put);
// getLog().info("Response from DC/OS [" + response.getStatusLine().getStatusCode() + "] " + IOUtils.toString(response.getEntity().getContent(), "UTF-8"));

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why removing this code block? Am I missing something?

String nexusPassword;


@Parameter(defaultValue = "${project.basedir}/.dcos-token", property = "dcosTokenFile", required = true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please indent line 31 to 40 to two spaces.


getLog().info(project.getArtifact().getFile().toString());

Process p = Runtime.getRuntime().exec("curl -u " + nexusUser + ":" + nexusPassword +" --upload-file "+ project.getArtifact().getFile().toString() + " http://" + nexusUrl + "/repository/" + nexusRepositoryName + "/");//file.toString());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, I`ll have a look at this tomorrow. Nice hack btw ;P

In this process world, I would call p.exitCode to make sure this process finished.

throw new RuntimeException("Artifact does not exist. Did you run mvn package dcos:pushArtifact?");
}

tmpPath = File.createTempFile("ucr-deploy", "json").toPath();
Copy link
Collaborator

Choose a reason for hiding this comment

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

@joerg84 I changed this to work in os tmp directory, hope this is ok for you.


getLog().info("Uploading this file: " + file.toString());

HttpPut put = new HttpPut("http://" + nexusUrl + "/repository/" + nexusRepositoryName + "/" + file.getName());
Copy link
Collaborator

Choose a reason for hiding this comment

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

file.getName() was missing here. curl --upload-file adds the filename to the url.

Copy link

Choose a reason for hiding this comment

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

Shouldn't the <nexusUrl> parameter also be including the protocol? Hardcoding it to http seems a bit weak?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yep, sounds good. Maybe it would be possible to do things like:

if nexusUrl includes protocol, use it, use http as fallback otherwise? Are you fancy providing a small patch or is @joerg84 willing to update the implementation? ❤️

@joerg84 joerg84 changed the title WIP: Ucr UCR Support Aug 28, 2017
@unterstein unterstein merged commit 9be55da into master Aug 28, 2017
@unterstein unterstein deleted the ucr branch August 28, 2017 16:39
@unterstein
Copy link
Collaborator

Thank you, you rock! 🤘

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.

3 participants