[JENKINS-34207] Display ports exposed and mapped by container#40
[JENKINS-34207] Display ports exposed and mapped by container#40jglick merged 4 commits intojenkinsci:masterfrom alecharp:JENKINS-34207
Conversation
|
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
|
How would you use this in a script? Seems like it would be more useful to run |
|
It could be useful for: it could be used the same way to trigger integration-tests with the port, with a curl or something like that. |
|
So I looked at the to have the same output and we would still have to write it to a file and then |
|
I just saw that my code was totally incorrect. I pushed a new one which is valid. |
|
Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests. |
|
@jglick don't you think it worth include this in the plugin? Redirecting the output of the |
|
LGTM |
|
The issue with the is currently written as with the possibility that the |
|
ok, then a better fix would be to get some descent support for returning value from a anyway, still LGTM as improvement to docker-pipeline DSL |
Yes, JENKINS-26133 is well known. Anyway I must still be missing something fundamental. The newly added method merely runs If you have some actual use case, write a functional test proving your addition works. |
Well, at least that is what |
I agree for |
|
So, delete |
| " def img = docker.image('httpd:2.4.12')\n" + | ||
| " def container = img.run('-p 12345:80')\n" + | ||
| " def port = container.port(80)\n" + | ||
| " container.stop()\n" + |
There was a problem hiding this comment.
🐜 safer to use
def port = img.withRun('-p 12345:80') {c -> c.port(80)}|
🐝 but |
|
I'm trying to resolve the conflict without adding useless (to this PR) commit in the branch |
Can be useful when the container is started with random port mapping.
Not sure what you mean. You need merely resolve, commit, and push. What is the problem? |
|
And please avoid rebasing. It makes it impossible to see your incremental changes. |
|
🐝 |
|
merging would have "imported" the commits on master here. Those commits would have nothing to do with the PR, when rebase just move the current branch to the new head of master. I understand it makes the incremental changes impossible to watch, but the commit graph in the end if much more easy to ready imo. |
No it does not. GitHub displays only those commits which are specific to the branch (not in the base branch). |
JENKINS-34207
Can be useful when the container is started with random port mapping.
@reviewbybees