Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ pipeline {
withAWSEnv(secret: 'secret/observability-team/ci/service-account/apm-aws-lambda', forceInstallation: true, version: '2.4.10') {
dir("${BASE_DIR}/apm-lambda-extension"){
cmd(label: 'make publish-in-all-aws-regions', script: 'make publish-in-all-aws-regions')
cmd(label: 'make create-arn-file', script: 'make create-arn-file')
stash(includes: "*${SUFFIX_ARN_FILE}", name: "arn-${isArm() ? 'arm' : 'amd'}")
stash(includes: "bin/${BRANCH_NAME}-*.zip", name: "dist-${isArm() ? 'arm' : 'amd'}")
}
Expand All @@ -143,6 +144,8 @@ pipeline {
post {
always {
archiveArtifacts(allowEmptyArchive: true, artifacts: "${BASE_DIR}/apm-lambda-extension/.regions")
archiveArtifacts(allowEmptyArchive: true, artifacts: "${BASE_DIR}/apm-lambda-extension/*${SUFFIX_ARN_FILE}")
archiveArtifacts(allowEmptyArchive: true, artifacts: "${BASE_DIR}/apm-lambda-extension/.aws")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This folder contains the output from the aws command publish-layer-version

As far as I see https://docs.aws.amazon.com/cli/latest/reference/lambda/publish-layer-version.html#output does not mention about any sensitive data in the output

image

Storing those files will help to debug what's going on if something bad happened while publishing a new release.

}
}
}
Expand Down
17 changes: 11 additions & 6 deletions .ci/create-arn-table.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ set -eo pipefail
# - SUFFIX_ARN_FILE - that's the output file.
#

ARN_FILE=${ARCHITECTURE}-${SUFFIX_ARN_FILE}

{
echo "### ARCH: ${ARCHITECTURE}"
echo ''
echo '|Region|Arch|ARN|'
echo '|------|----|---|'
for f in $(ls "${AWS_FOLDER}"); do
# TODO: identify what field to be used.
echo "|${f}|${ARCHITECTURE}|$(cat $AWS_FOLDER/${f} | jq -r .LayerVersionArn)|"
done
echo ''
} > ${ARCHITECTURE}-${SUFFIX_ARN_FILE}
} > "${ARN_FILE}"

for f in $(ls "${AWS_FOLDER}"); do
LAYER_VERSION_ARN=$(jq -r .LayerVersionArn "$AWS_FOLDER/${f}")
echo "INFO: create-arn-table ARN(${LAYER_VERSION_ARN}):region(${f}):arch(${ARCHITECTURE})"
echo "|${f}|${ARCHITECTURE}|${LAYER_VERSION_ARN}|" >> "${ARN_FILE}"
done

echo '' >> "${ARN_FILE}"
1 change: 0 additions & 1 deletion apm-lambda-extension/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ publish-in-all-aws-regions: validate-layer-name get-all-aws-regions
echo "publish '$(ELASTIC_LAYER_NAME)' in $${AWS_DEFAULT_REGION}"; \
AWS_DEFAULT_REGION="$${AWS_DEFAULT_REGION}" ELASTIC_LAYER_NAME=$(ELASTIC_LAYER_NAME) $(MAKE) publish > $(AWS_FOLDER)/$${AWS_DEFAULT_REGION}; \
done <.regions
$(MAKE) create-arn-file

# Publish the given LAYER in the given AWS region
publish: validate-layer-name validate-aws-default-region
Expand Down