Skip to content

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

Merged
merged 1 commit into from
Mar 4, 2016
Merged

Run post commit and pre-push command #1448

merged 1 commit into from
Mar 4, 2016

Conversation

PI-Victor
Copy link

@PI-Victor
Copy link
Author

@rhcarvalho ping.

@@ -1109,6 +1109,27 @@ The following example shows the part of a `*BuildConfig*` specifying
----
====

[[post-build-actions]]

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".

@PI-Victor PI-Victor changed the title [WIP] Run post build and pre-push command [WIP] Run post commit and pre-push command Jan 21, 2016
@PI-Victor
Copy link
Author

@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.
make some comments if you find anything that needs rewording i might have forgotten something from our conversation today.

@@ -93,6 +93,10 @@ spec:
to:
kind: "ImageStreamTag"
name: "origin-ruby-sample:latest"
postCommit: <6>
command: "sh -c",
args: "rake test"

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.

@rhcarvalho
Copy link

@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
Copy link
Contributor

Choose a reason for hiding this comment

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

s/being//

@PI-Victor
Copy link
Author

@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

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"?

Copy link
Contributor

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 :)

Copy link
Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

s/Normally, //

@bparees
Copy link
Contributor

bparees commented Feb 24, 2016

@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>
@PI-Victor
Copy link
Author

@bparees thanks i've updated
@adellape i think we're good, can you take a look

@bparees
Copy link
Contributor

bparees commented Feb 24, 2016

lgtm

@rhcarvalho
Copy link

lgtm

@adellape ptal

@rhcarvalho
Copy link

@PI-Victor please remove the "WIP" from the title.

@adellape ptal

@PI-Victor PI-Victor changed the title [WIP] Run post commit and pre-push command Run post commit and pre-push command Feb 26, 2016
@PI-Victor
Copy link
Author

👍 ping @openshift/team-documentation

@rhcarvalho
Copy link

@openshift/team-documentation @tnguyen-rh @adellape ping

@adellape
Copy link
Contributor

adellape commented Mar 4, 2016

@PI-Victor @rhcarvalho 👍 Thanks.

@adellape adellape added this to the Future Release milestone Mar 4, 2016
adellape added a commit that referenced this pull request Mar 4, 2016
@adellape adellape merged commit a6bb2e3 into openshift:master Mar 4, 2016
@PI-Victor PI-Victor deleted the pi-victor/post_build_actions branch April 15, 2016 22:59
@adellape
Copy link
Contributor

[rev_history]
|link../dev_guide/builds.html[Builds]
|Added a link:../dev_guide/builds.html#build-hooks[Build Hooks] section.
%

@adellape adellape modified the milestones: OSE 3.2, Future Release Apr 22, 2016
@bfallonf bfallonf self-assigned this May 4, 2016
adellape added a commit that referenced this pull request May 5, 2016
Followup to #1448: Edits to the dev_guide.builds file
@adellape adellape modified the milestones: OSE 3.2, Staging, OSE 3.2 (Picked) May 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants