Skip to content

Commit

Permalink
fix: add documentation for the :zip command (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislwade authored Apr 26, 2021
1 parent 7c7c56c commit 0777961
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,10 @@ source_path = [
]
}, {
path = "src/python3.8-app3",
commands = ["npm install"],
commands = [
"npm install",
":zip"
],
patterns = [
"!.*/.*\\.txt", # Skip all txt files recursively
"node_modules/.+", # Include all node_modules
Expand Down Expand Up @@ -424,6 +427,7 @@ Few notes:
```

* `commands` - List of commands to run. If specified, this argument overrides `pip_requirements`.
* `:zip [source] [destination]` is a special command which creates content of current working directory (first argument) and places it inside of path (second argument).
* `pip_requirements` - Controls whether to execute `pip install`. Set to `false` to disable this feature, `true` to run `pip install` with `requirements.txt` found in `path`. Or set to another filename which you want to use instead.
* `prefix_in_zip` - If specified, will be used as a prefix inside zip-archive. By default, everything installs into the root of zip-archive.

Expand Down
15 changes: 12 additions & 3 deletions examples/simple/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,10 @@ module "lambda_function" {
# },
# {
# path = "${path.module}/../fixtures/python3.8-app1"
# commands = ["npm install"]
# commands = [
# "npm install",
# ":zip"
# ]
# prefix_in_zip = "foo/bar",
# patterns = [
# "!.*/.*\\.txt", # Filter all txt files recursively
Expand All @@ -264,7 +267,10 @@ module "lambda_function" {
# },
# {
# path = "${path.module}/../fixtures/python3.8-app1"
# commands = ["npm install"]
# commands = [
# "npm install",
# ":zip"
# ]
# prefix_in_zip = "foo/bar", # By default everything installs into the root of a zip package
# patterns = <<END
# !.*/.*\.txt # Filter all txt files recursively
Expand All @@ -281,7 +287,10 @@ module "lambda_function" {
# },
# {
# path = "${path.module}/../fixtures/python3.8-app1"
# commands = ["npm install"]
# commands = [
# "npm install",
# ":zip"
# ]
# prefix_in_zip = "foo/bar",
# patterns = [".*"] # default
# }
Expand Down

0 comments on commit 0777961

Please sign in to comment.