-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Run post commit and pre-push command #1448
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
Run post commit and pre-push command #1448
Conversation
@rhcarvalho ping. |
@@ -1109,6 +1109,27 @@ The following example shows the part of a `*BuildConfig*` specifying | |||
---- | |||
==== | |||
|
|||
[[post-build-actions]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not "post build", we've been calling it "post commit".
@rhcarvalho can you review this? i think it's in a more finished state now. also you were right about replacing json with yaml so i also had to convert the examples. also eliminated the changes to api_v1.adoc. |
@@ -93,6 +93,10 @@ spec: | |||
to: | |||
kind: "ImageStreamTag" | |||
name: "origin-ruby-sample:latest" | |||
postCommit: <6> | |||
command: "sh -c", | |||
args: "rake test" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that command and args are string arrays.
This example is invalid according to our API validation, as one cannot have command and script together.
I'd keep this simple and just use "script". We can describe the other possibilities further down.
@PI-Victor we're in good shape, just need to review the syntax and improve on the parts where we're including invalid examples (command and script together). We don't want copy-pastes from the docs to result in validation error 😄 |
== Build Hooks | ||
|
||
Build hooks can be used as a part of the build flow to run tests inside a | ||
temporary container and validate your image before it is being pushed to a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/being//
@bparees corrected @rhcarvalho hey, updated this, what do you think? |
@@ -110,6 +112,11 @@ This above example uses the `*ruby-20-centos7*` Docker image that | |||
Source-To-Image will use for the application build. | |||
<5> After the Docker image is successfully built, it will be pushed into the | |||
repository described in the `*output*` section. | |||
<6> In `*postCommit*` you can specify a link:#build-hooks[command] to be | |||
executed in a temporary container running the build output image, immediately | |||
after the last layer of the image is committed and before the image is pushed to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"is committed" -> "has been committed"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think either is ok, but we can let the tech writers decide :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'll change it to has been committed.
before the image is pushed to a registry. | ||
|
||
The current working directory is set to the image's `*WORKDIR*`, the default | ||
working directory of the Docker image. Normally, for most images, this is where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Normally, //
@rhcarvalho done, one nit and one suggestion for your question. |
Run a test command in a shell on the output image reference before it gets pushed to the registry Signed-off-by: pi-victor <ipalade@redhat.com>
lgtm |
lgtm @adellape ptal |
@PI-Victor please remove the "WIP" from the title. @adellape ptal |
👍 ping @openshift/team-documentation |
@openshift/team-documentation @tnguyen-rh @adellape ping |
@PI-Victor @rhcarvalho 👍 Thanks. |
Run post commit and pre-push command
[rev_history] |
Followup to #1448: Edits to the dev_guide.builds file
trello card ref: https://trello.com/c/I1v1YeOf/844-8-implement-post-build-command
Signed-off-by: pi-victor ipalade@redhat.com