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

Enhancements to `hab plan init` #1629

Merged
merged 1 commit into from Jan 9, 2017

Conversation

Projects
None yet
6 participants
@smith
Collaborator

smith commented Jan 9, 2017

  • Add all of the variables listed in the docs
  • Make the variable be listed in the same order as they are in the docs
    (this is probably the wrong order for what we want in the end, but
    it's now consistent between the two and can be argued about later.)
  • Allow all "pkg_*" variables (except name and origin) to be set by environment
    variables. So now you can type:
    env pkg_svc_user=me pkg_deps="(core/foo core/bar)" \
      pkg_license="('MIT' 'Apache-2.0')" pkg_bin_dirs="(bin sbin)" \
      pkg_version=1.0.0 pkg_description="foo" pkg_maintainer="you" \
      hab plan init foo

and it does what you would want.

Signed-off-by: Nathan L Smith smith@chef.io

Nathan L Smith
Enhancements to `hab plan init`
* Add all of the variables listed in the docs
* Make the variable be listed in the same order as they are in the docs
  (this is probably the wrong order for what we want in the end, but
  it's now consistent between the two and can be argued about later.)
* Allow all "pkg_*" variables (except name and origin) to be set by environment
  variables. So now you can type:

    env pkg_svc_user=me pkg_deps="(core/foo core/bar)" \
      pkg_license="('MIT' 'Apache-2.0')" pkg_bin_dirs="(bin sbin)" \
      pkg_version=1.0.0 pkg_description="foo" pkg_maintainer="you" \
      hab plan init foo

and it does what you would want.

Signed-off-by: Nathan L Smith <smith@chef.io>
@thesentinels

This comment has been minimized.

Show comment
Hide comment
@thesentinels

thesentinels Jan 9, 2017

Contributor

Thanks for the pull request! Here is what will happen next:

  1. Your PR will be reviewed by the maintainers
  2. If everything looks good, one of them will approve it, and your PR will be merged.

Thank you for contributing!

Contributor

thesentinels commented Jan 9, 2017

Thanks for the pull request! Here is what will happen next:

  1. Your PR will be reviewed by the maintainers
  2. If everything looks good, one of them will approve it, and your PR will be merged.

Thank you for contributing!

@mwrock

This comment has been minimized.

Show comment
Hide comment
@mwrock

mwrock Jan 9, 2017

Contributor

This looks good, I'm just curious about the value of the environment variable use case. I'm not saying its not valuable, but it just seems to me just as simple to edit the template than to set the environment variables. So I'd just like to hear the motivation and put this out there to protect against "feature bloat."

Contributor

mwrock commented Jan 9, 2017

This looks good, I'm just curious about the value of the environment variable use case. I'm not saying its not valuable, but it just seems to me just as simple to edit the template than to set the environment variables. So I'd just like to hear the motivation and put this out there to protect against "feature bloat."

@smith

This comment has been minimized.

Show comment
Hide comment
@smith

smith Jan 9, 2017

Collaborator

I'm not saying its not valuable, but it just seems to me just as simple to edit the template than to set the environment variables. So I'd just like to hear the motivation and put this out there to protect against "feature bloat."

It seemed to me that this is how I would expect it to work.

I saw @fnichol using https://github.com/jpmens/jo and liked the way that works. With jo, you could also say it's just as easy to edit a blank file and start writing JSON, which might be true, but having an obvious way to pre-populate the values is even nicer.

Collaborator

smith commented Jan 9, 2017

I'm not saying its not valuable, but it just seems to me just as simple to edit the template than to set the environment variables. So I'd just like to hear the motivation and put this out there to protect against "feature bloat."

It seemed to me that this is how I would expect it to work.

I saw @fnichol using https://github.com/jpmens/jo and liked the way that works. With jo, you could also say it's just as easy to edit a blank file and start writing JSON, which might be true, but having an obvious way to pre-populate the values is even nicer.

@fnichol

This comment has been minimized.

Show comment
Hide comment
@fnichol

fnichol Jan 9, 2017

Member

That is rather cute 😄 I could see some interesting potential for one-off package builds and possibly some CI creation tasks.

@thesentinels approve

Member

fnichol commented Jan 9, 2017

That is rather cute 😄 I could see some interesting potential for one-off package builds and possibly some CI creation tasks.

@thesentinels approve

@thesentinels

This comment has been minimized.

Show comment
Hide comment
@thesentinels

thesentinels Jan 9, 2017

Contributor

🤘 I am testing your branch against master before merging it. We do this to ensure that the master branch is never failing tests.

Contributor

thesentinels commented Jan 9, 2017

🤘 I am testing your branch against master before merging it. We do this to ensure that the master branch is never failing tests.

@thesentinels

This comment has been minimized.

Show comment
Hide comment
@thesentinels

thesentinels Jan 9, 2017

Contributor

:neckbeard: Travis CI has started testing this PR.

Contributor

thesentinels commented Jan 9, 2017

:neckbeard: Travis CI has started testing this PR.

@mwrock

This comment has been minimized.

Show comment
Hide comment
@mwrock

mwrock Jan 9, 2017

Contributor

Yeah I was thinking more on this and could definitely see the value for auto generating plans.

Contributor

mwrock commented Jan 9, 2017

Yeah I was thinking more on this and could definitely see the value for auto generating plans.

@thesentinels

This comment has been minimized.

Show comment
Hide comment
@thesentinels

thesentinels Jan 9, 2017

Contributor

💖 Travis CI reports this PR passed.

It always makes me feel nice when humans approve of one anothers work. I'm merging this PR now.

I just want you and the contributor to answer me one question:

gif-keyboard-3280869874741411265

Contributor

thesentinels commented Jan 9, 2017

💖 Travis CI reports this PR passed.

It always makes me feel nice when humans approve of one anothers work. I'm merging this PR now.

I just want you and the contributor to answer me one question:

gif-keyboard-3280869874741411265

@thesentinels thesentinels merged commit 3e16f68 into master Jan 9, 2017

3 checks passed

DCO This commit has a DCO Signed-off-by line
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@thesentinels thesentinels deleted the nls/env-vars-in-init branch Jan 9, 2017

@fnichol fnichol added the Feature label Jan 9, 2017

@reset

This comment has been minimized.

Show comment
Hide comment
@reset

reset Jan 9, 2017

Member

@smith great additions here, thank you! I can especially see the value in setting the generated values of a plan by env var when using an automated process to generate plans

Member

reset commented Jan 9, 2017

@smith great additions here, thank you! I can especially see the value in setting the generated values of a plan by env var when using an automated process to generate plans

@eeyun eeyun added C-feature and removed Feature labels Jun 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment