Skip to content

Commit

Permalink
add thing policy name (#21)
Browse files Browse the repository at this point in the history
Co-authored-by: guoje <[email protected]>
  • Loading branch information
jie0917 and guoje authored Aug 4, 2021
1 parent b83c972 commit 906565f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ ENV TINI_KILL_PROCESS_GROUP=1 \
COMPONENT_DEFAULT_USER=default_component_user \
DEPLOY_DEV_TOOLS=false \
INIT_CONFIG=default_init_config \
TRUSTED_PLUGIN=default_trusted_plugin_path
TRUSTED_PLUGIN=default_trusted_plugin_path \
THING_POLICY_NAME=default_thing_policy_name
RUN env

# Entrypoint script to install and run Greengrass
Expand Down
8 changes: 7 additions & 1 deletion greengrass-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ parse_options() {
# If thing group name is specified, add optional argument
if [ ${THING_GROUP_NAME} != default_thing_group_name ]; then
OPTIONS="${OPTIONS} --thing-group-name ${THING_GROUP_NAME}"

fi

# If thing group policy is specified, add optional argument
if [ ${THING_POLICY_NAME} != default_thing_policy_name ]; then
OPTIONS="${OPTIONS} --thing-policy-name ${THING_POLICY_NAME}"
fi
fi

# If TRUSTED_PLUGIN is specified, add optional argument
Expand Down Expand Up @@ -91,4 +97,4 @@ chmod +x $GGC_ROOT_PATH/alts/current/distro/bin/loader
echo "Starting Greengrass..."

# Start greengrass kernel via the loader script and register container as a thing
exec $GGC_ROOT_PATH/alts/current/distro/bin/loader
exec $GGC_ROOT_PATH/alts/current/distro/bin/loader

0 comments on commit 906565f

Please sign in to comment.