#!/bin/bash # Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 #################################################### # Helper Functions #################################################### _create_deployment_file() { local filepath=$1 local container_name=$2 local repository_uri=$3 readonly file_content=$(cat< $filepath || return $FAILURE restore_ifs return $SUCCESS } #################################################### # Events #################################################### on_run() { return $SUCCESS } on_file_requested() { local filename=$1 local target_dir=$2 local retval=$SUCCESS case $filename in "hello_deployment.yaml") local fullpath=$target_dir/$filename local container_name=$3; local repository_uri=$4; _create_deployment_file "$fullpath" "$container_name" "$repository_uri"; retval=$?; ;; *) say_err "${FUNCNAME[0]}: Requested file $1 is unknown." retval=$FAILURE ;; esac return $retval } on_stop() { return $SUCCESS }