Skip to content

Commit

Permalink
docs: Improved package.py error message for missing source_paths (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
ers81239 authored Dec 31, 2020
1 parent c56f965 commit f1abf32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ terraform apply

## <a name="build"></a> Build Dependencies

You can specify `source_path` in a variety of ways to achieve desired flexibility when building deployment packages locally or in Docker. You can use absolute or relative paths.
You can specify `source_path` in a variety of ways to achieve desired flexibility when building deployment packages locally or in Docker. You can use absolute or relative paths. If you have placed terraform files in subdirectories, note that relative paths are specified from the directory where `terraform plan` is run and not the location of your terraform file.

Note that, when building locally, files are not copying anywhere from the source directories when making packages, we use fast Python regular expressions to find matching files and directories, which makes packaging very fast and easy to understand.

Expand Down
5 changes: 4 additions & 1 deletion package.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,10 @@ def commands_step(path, commands):
if isinstance(claim, str):
path = claim
if not os.path.exists(path):
abort('source_path must be set.')
abort('Could not locate source_path "{path}". Paths are relative to directory where `terraform plan` is being run ("{pwd}")'.format(
path=path,
pwd=os.getcwd()
))
runtime = query.runtime
if runtime.startswith('python'):
pip_requirements_step(
Expand Down

0 comments on commit f1abf32

Please sign in to comment.