Skip to content

Commit

Permalink
fixup! ci(release): Updating release script to be fault tolerant
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Jul 25, 2024
1 parent 80cad2e commit f4c5dc4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions aws/logs_monitoring/tools/publish_layers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ index_of_layer() {
}

publish_layer() {
region=$1
layer_name=$2
aws_version_key=$3
layer_path=$4
region="${1}"
layer_name="${2}"
aws_version_key="${3}"
layer_path="${4}"

version_nbr=$(aws lambda publish-layer-version --layer-name "${layer_name}" \
--description "Datadog Forwarder Layer Package" \
Expand All @@ -162,11 +162,15 @@ publish_layer() {
--cli-read-timeout 60 |
jq -r '.Version')

permission=$(aws lambda add-layer-version-permission --layer-name "${layer_name}" \
if [[ -z ${version_nbr:-} ]]; then
return 1
fi

aws lambda add-layer-version-permission --layer-name "${layer_name}" \
--version-number "${version_nbr}" \
--statement-id "release-$version_nbr" \
--action lambda:GetLayerVersion --principal "*" \
--region "${region}")
--action "lambda:GetLayerVersion" --principal "*" \
--region "${region}"

echo "${version_nbr}"
}
Expand Down

0 comments on commit f4c5dc4

Please sign in to comment.