Skip to content

Commit

Permalink
Add support for shared path (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
victorpoluceno authored Feb 13, 2023
1 parent 49c6363 commit 957cef5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The `deploy` command contains many options which can be passed as environment va
| KR_BASE_OVERLAY_PATH | The path containing the base kustomize overlay to be used. | src/deploy/resources/base | false |
| KR_OVERLAY_PATH | The path containing a kustomize overlay to be used. | - | false |
| KR_VERBOSE | Prints verbose or debug messages. Should not be used in production. | false | false |
| KR_SHARED_PATH | The path of a folder that will be copied to `__shared_path/` folder into the overlay path. Can be used to load files from the host as configMaps, for example. | - | false |

### Restart Command

Expand Down
6 changes: 6 additions & 0 deletions src/deploy/deploy
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ url=https://$host
kube_context=$KR_KUBE_CONTEXT
test_connection=${KR_TEST_CONNECTION:-true}
test_connection_url_path=${KR_TEST_CONNECTION_URL_PATH:-"/"}
shared_path=$KR_SHARED_PATH
overlay_path=$KR_OVERLAY_PATH
base_overlay_path=${KR_BASE_OVERLAY_PATH:-"src/deploy/resources/base"}
delete_before_apply=${KR_DELETE_BEFORE_APPLY:-false}
Expand Down Expand Up @@ -89,6 +90,11 @@ install_resources () {
cd "$work_dir/overlay"
fi

# Copy files to shared path if it is present
if [ "$shared_path" != "" ]; then
cp -R "$shared_path" "./__shared_path"
fi

kustomize edit set namespace "$namespace"
kustomize edit add annotation --force \
app.kubernetes.io/instance:"$namespace" \
Expand Down

0 comments on commit 957cef5

Please sign in to comment.