From 906565f9c273168a6f436fe3b01dfbbb4f7d759f Mon Sep 17 00:00:00 2001 From: jie0917 Date: Wed, 4 Aug 2021 13:17:00 -0700 Subject: [PATCH] add thing policy name (#21) Co-authored-by: guoje --- Dockerfile | 3 ++- greengrass-entrypoint.sh | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 30cf3c4..bbaa405 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/greengrass-entrypoint.sh b/greengrass-entrypoint.sh index 354839c..f7c3cb9 100644 --- a/greengrass-entrypoint.sh +++ b/greengrass-entrypoint.sh @@ -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 @@ -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 \ No newline at end of file +exec $GGC_ROOT_PATH/alts/current/distro/bin/loader