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

Publish Docker container output to Jenkins #28

Closed
wants to merge 1 commit into from

Conversation

sboschman
Copy link
Contributor

When the shit hits the fan it can be useful to have the output from the Docker container linked to a Jenkins build. This patch adds a Jenkins TaskAction to the build with a little Docker icon in the left-hand panel. Behaviour of the action is similar to the normal console output, but showing the output of the Docker container instead.

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

public DockerLogMessage nextMessage() throws IOException {
// Read header
final byte[] headerBytes = new byte[HEADER_SIZE];
final int n = ByteStreams.read(stream, headerBytes, 0, HEADER_SIZE);
Copy link
Member

Choose a reason for hiding this comment

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

Hi, does this work for you? Which version are you on? On my machine ("ApiVersion":"1.17","Version":"1.5.0") header is for some reason skipped and input stream contains only the container output (causing issues, as it results into nonsense buffer size). Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

well, solved - it depends on TTY setup - when enabled, it sends raw stream without any headers

@vjuranek
Copy link
Member

Merged, thanks!

@vjuranek vjuranek closed this Mar 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants