Skip to content

Adding --build-env and --build-env-file to oc new-app #12455

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
Jan 16, 2017
Merged

Adding --build-env and --build-env-file to oc new-app #12455

merged 1 commit into from
Jan 16, 2017

Conversation

coreydaley
Copy link
Member

Adding new flags (--build-env and --build-env-file) to facilitate adding environment variables to the build config at app creation instead of having to stop the build, and create a new build with the environment variables.

Also adding --build-env and --build-env-file (as hidden) flags to oc new-build (as "aliases").

@coreydaley coreydaley changed the title WIP: Adding --build-env and --build-env-file to oc new-app Adding --build-env and --build-env-file to oc new-app Jan 12, 2017
@coreydaley coreydaley requested review from mmilata and bparees January 12, 2017 21:41
@coreydaley
Copy link
Member Author

@openshift/cli-review ptal

@coreydaley
Copy link
Member Author

[test]

return nil, nil, err
return nil, nil, nil, err
}
buildEnv, err := app.ParseAndCombineEnvironment(c.BuildEnvironment, c.BuildEnvironmentFiles, c.In, func(key, file string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

this isn't going to work if i invoke "oc new-build --env", is it?

Copy link
Contributor

Choose a reason for hiding this comment

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

(or --env-file)

Copy link
Member Author

Choose a reason for hiding this comment

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

GetBuildEnvironment calls c.validate() which returns the data there, which is called by the pipeline builder on line 285. I could probably refactor the code there to to remove passing environment to GetBuildEnvironment since it's not used anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see where you're including the value of the "--env" parameter when running "oc new-build".

Copy link
Member Author

Choose a reason for hiding this comment

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

anything passed to --env is being stored in the &config.BuildEnvironment, which is used as c.BuildEnvironment here.

Copy link
Contributor

Choose a reason for hiding this comment

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

got it, thanks i missed the change to the field being used by the --env.

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to f05aedf

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12864/) (Base Commit: b7ed175)

@coreydaley
Copy link
Member Author

@bparees
Copy link
Contributor

bparees commented Jan 16, 2017

lgtm, awaiting @openshift/cli-review approval.

@coreydaley coreydaley removed the request for review from mmilata January 16, 2017 15:17
@fabianofranz
Copy link
Member

LGTM

@bparees
Copy link
Contributor

bparees commented Jan 16, 2017

[merge]

@bparees bparees self-assigned this Jan 16, 2017
@openshift-bot
Copy link
Contributor

openshift-bot commented Jan 16, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12864/) (Image: devenv-rhel7_5690)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to f05aedf

@openshift-bot openshift-bot merged commit cd9fd8e into openshift:master Jan 16, 2017
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.

4 participants