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

Update pack build flags #1042

Merged
merged 1 commit into from
Jan 27, 2021
Merged

Update pack build flags #1042

merged 1 commit into from
Jan 27, 2021

Conversation

dfreilich
Copy link
Member

  • Reorder alphabetically
  • Add clarification note to --env and --env-file flags that the envs aren't set as runtime dependencies

Signed-off-by: David Freilich dfreilich@vmware.com

Summary

Output

Before

$  pack build -h
...
Flags:
  -B, --builder string              Builder image (default "paketobuildpacks/builder:base")
  -b, --buildpack strings           Buildpack to use. One of:
                                      a buildpack by id and version in the form of '<buildpack>@<version>',
                                      path to a buildpack directory (not supported on Windows),
                                      path/URL to a buildpack .tar or .tgz file, or
                                      a packaged buildpack image name in the form of '<hostname>/<repo>[:<tag>]'
                                    Repeat for each buildpack in order,
                                      or supply once by comma-separated list
  -r, --buildpack-registry string   Buildpack Registry by name
      --cache-image string          Cache build layers in remote registry. Requires --publish
      --clear-cache                 Clear image's associated cache before building
  -D, --default-process string      Set the default process type. (default "web")
  -d, --descriptor string           Path to the project descriptor file
  -e, --env stringArray             Build-time environment variable, in the form 'VAR=VALUE' or 'VAR'.
                                    When using latter value-less form, value will be taken from current
                                      environment at the time this command is executed.
                                    This flag may be specified multiple times and will override
                                      individual values defined by --env-file.
      --env-file stringArray        Build-time environment variables file
                                    One variable per line, of the form 'VAR=VALUE' or 'VAR'
                                    When using latter value-less form, value will be taken from current
                                      environment at the time this command is executed
  -h, --help                        Help for 'build'
      --network string              Connect detect and build containers to network
  -p, --path string                 Path to app dir or zip-formatted file (defaults to current working directory)
      --publish                     Publish to registry
      --pull-policy string          Pull policy to use. Accepted values are always, never, and if-not-present. (default "always")
      --run-image string            Run image (defaults to default stack's run image)
  -t, --tag strings                 Additional tags to push the output image to.
                                    Repeat for each tag in order,
                                      or supply once by comma-separated list
      --trust-builder               Trust the provided builder
                                    All lifecycle phases will be run in a single container (if supported by the lifecycle).
      --volume stringArray          Mount host volume into the build container, in the form '<host path>:<target path>[:<options>]'.
                                    - 'host path': Name of the volume or absolute directory path to mount.
                                    - 'target path': The path where the file or directory is available in the container.
                                    - 'options' (default "ro"): An optional comma separated list of mount options.
                                        - "ro", volume contents are read-only.
                                        - "rw", volume contents are readable and writeable.
                                        - "volume-opt=<key>=<value>", can be specified more than once, takes a key-value pair consisting of the option name and its value.
                                    Repeat for each volume in order,
                                      or supply once by comma-separated list

After

 $  go run cmd/pack/main.go build -h
...
Flags:
  -B, --builder string              Builder image (default "paketobuildpacks/builder:base")
  -b, --buildpack strings           Buildpack to use. One of:
                                      a buildpack by id and version in the form of '<buildpack>@<version>',
                                      path to a buildpack directory (not supported on Windows),
                                      path/URL to a buildpack .tar or .tgz file, or
                                      a packaged buildpack image name in the form of '<hostname>/<repo>[:<tag>]'
                                    Repeat for each buildpack in order, or supply once by comma-separated list
  -r, --buildpack-registry string   Buildpack Registry by name
      --cache-image string          Cache build layers in remote registry. Requires --publish
      --clear-cache                 Clear image's associated cache before building
  -D, --default-process string      Set the default process type. (default "web")
  -d, --descriptor string           Path to the project descriptor file
  -e, --env stringArray             Build-time environment variable, in the form 'VAR=VALUE' or 'VAR'.
                                    When using latter value-less form, value will be taken from current
                                      environment at the time this command is executed.
                                    This flag may be specified multiple times and will override
                                      individual values defined by --env-file.
                                    Repeat for each env in order, or supply once by comma-separated list
                                    NOTE: These are NOT available at image runtime.
      --env-file stringArray        Build-time environment variables file
                                    One variable per line, of the form 'VAR=VALUE' or 'VAR'
                                    When using latter value-less form, value will be taken from current
                                      environment at the time this command is executed
                                    NOTE: These are NOT available at image runtime."
  -h, --help                        Help for 'build'
      --network string              Connect detect and build containers to network
  -p, --path string                 Path to app dir or zip-formatted file (defaults to current working directory)
      --publish                     Publish to registry
      --pull-policy string          Pull policy to use. Accepted values are always, never, and if-not-present. (default "always")
      --run-image string            Run image (defaults to default stack's run image)
  -t, --tag strings                 Additional tags to push the output image to.
                                    Repeat for each tag in order, or supply once by comma-separated list
      --trust-builder               Trust the provided builder
                                    All lifecycle phases will be run in a single container (if supported by the lifecycle).
      --volume stringArray          Mount host volume into the build container, in the form '<host path>:<target path>[:<options>]'.
                                    - 'host path': Name of the volume or absolute directory path to mount.
                                    - 'target path': The path where the file or directory is available in the container.
                                    - 'options' (default "ro"): An optional comma separated list of mount options.
                                        - "ro", volume contents are read-only.
                                        - "rw", volume contents are readable and writeable.
                                        - "volume-opt=<key>=<value>", can be specified more than once, takes a key-value pair consisting of the option name and its value.
                                    Repeat for each volume in order, or supply once by comma-separated list

Documentation

  • Should this change be documented?
    • No

Related

Resolves #914

* Reorder alphabetically
* Add clarification note to --env and --env-file flags that the envs aren't set as runtime dependencies

Signed-off-by: David Freilich <dfreilich@vmware.com>
@dfreilich dfreilich requested a review from a team as a code owner January 27, 2021 20:04
@github-actions github-actions bot added this to the 0.17.0 milestone Jan 27, 2021
@github-actions github-actions bot added the type/enhancement Issue that requests a new feature or improvement. label Jan 27, 2021
@codecov
Copy link

codecov bot commented Jan 27, 2021

Codecov Report

Merging #1042 (972bf37) into main (c911002) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1042      +/-   ##
==========================================
+ Coverage   80.23%   80.23%   +0.01%     
==========================================
  Files         130      130              
  Lines        7993     7990       -3     
==========================================
- Hits         6412     6410       -2     
+ Misses       1161     1160       -1     
  Partials      420      420              
Flag Coverage Δ
os_linux 79.51% <100.00%> (-0.04%) ⬇️
os_macos 76.91% <100.00%> (+0.03%) ⬆️
os_windows 80.14% <100.00%> (+0.04%) ⬆️
unit 79.60% <100.00%> (-<0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@dfreilich dfreilich merged commit f5e809d into main Jan 27, 2021
@dfreilich dfreilich deleted the 914-clarify-env-vars branch January 27, 2021 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Environment variables not accessible at Runtime
1 participant