Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jenkins 2 GH Actions Workflow Migration #362

Merged
merged 52 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
205edaf
Create goreleaser config
reakaleek Jan 24, 2023
496d7bc
Add test workflow
reakaleek Jan 24, 2023
ae175a7
Adjust scripts
reakaleek Jan 24, 2023
fc84cb2
Adjust scripts for release
reakaleek Jan 24, 2023
c875cba
Remove draft flag
reakaleek Jan 24, 2023
483096f
Fix NOTICE.txt rule
reakaleek Jan 24, 2023
503d36d
Remove deprecated files
reakaleek Jan 24, 2023
90a8390
Add smoke test rules again
reakaleek Jan 24, 2023
0a7eefd
Remove outputs
reakaleek Jan 25, 2023
fbd2a69
Add slack notification
reakaleek Jan 25, 2023
03751bc
Update .ci/publish-aws.sh
reakaleek Jan 25, 2023
b564627
Adjust shebang
reakaleek Jan 25, 2023
88f138d
Use make to the release
reakaleek Jan 25, 2023
37f2b84
Move test command to Makfile
reakaleek Jan 25, 2023
ef2f485
Fix build command
reakaleek Jan 25, 2023
7b1c80c
Add opentelemtry workflow
reakaleek Jan 25, 2023
f3b775a
Add opencontainers labels
reakaleek Jan 25, 2023
b23272a
Use more specific version for vault-action
reakaleek Jan 25, 2023
69f52a5
Fix build test
reakaleek Jan 25, 2023
e983461
Run build on a seperate job
reakaleek Jan 25, 2023
2cc8c07
Pin gotestsum version
reakaleek Jan 25, 2023
3875305
Make sure extension file filename is consistent in docker iamge
reakaleek Jan 25, 2023
26ad58d
Add description to scripts
reakaleek Jan 25, 2023
5ac2888
Use env to create docker image tag
reakaleek Jan 25, 2023
43ab35c
Formatting
reakaleek Jan 25, 2023
575766d
Mark PHONY rules
reakaleek Jan 25, 2023
818ba18
Use Make rule for notice.txt
reakaleek Jan 25, 2023
e527f43
Move check-licences to Makefile rule
reakaleek Jan 25, 2023
6b3bb5a
Move notice check to Makefile rule
reakaleek Jan 25, 2023
b5323fa
Move to Makefile rule
reakaleek Jan 25, 2023
9589f03
Remove excess newlines
reakaleek Jan 25, 2023
66d3978
Use new channel name
reakaleek Jan 25, 2023
02aa3fe
Move to Makefile rule
reakaleek Jan 25, 2023
1333286
Set access and modification times for reproducible builds
reakaleek Jan 25, 2023
71bc0e2
Fix docker build in test
reakaleek Jan 25, 2023
8bd2e43
Use `go run ...` instead of binary
reakaleek Jan 25, 2023
ec50ef8
Update .ci/publish-aws.sh
reakaleek Jan 25, 2023
b1c1134
Add compatible-architectures metadata
reakaleek Jan 25, 2023
858bd19
Delete zip without custom build_time and rename the zip to the origin…
reakaleek Jan 25, 2023
342f1d1
Merge branch 'main' into feature/jenkinsfile-2-gh-actions-workflow-mi…
reakaleek Jan 26, 2023
c9ad1d7
Remove check-extension rule
reakaleek Jan 30, 2023
8975604
Use goreleaser's mtime option to set the buildinfo in archives
reakaleek Feb 2, 2023
d15a6b9
Fix Dockerfile
reakaleek Feb 2, 2023
ccb7116
Use existing .CommitTimestamp
reakaleek Feb 2, 2023
645fcfd
Set mtime also for files
reakaleek Feb 2, 2023
8dc2d5e
Remove unused SOURCE_DATE_EPOCH
reakaleek Feb 2, 2023
2c52010
Add zip rule
reakaleek Feb 2, 2023
57d1dcb
Refactor
reakaleek Feb 2, 2023
a3fc374
Add .PHONY where missing
reakaleek Feb 2, 2023
d1b6db3
Failsafe clean rule
reakaleek Feb 2, 2023
2a93275
Update Dockerfile
reakaleek Feb 13, 2023
daa0cee
Update Dockerfile
reakaleek Feb 13, 2023
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
248 changes: 0 additions & 248 deletions .ci/Jenkinsfile

This file was deleted.

45 changes: 0 additions & 45 deletions .ci/jobs/apm-aws-lambda-mbp.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .ci/publish-aws.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env bash
set -euo pipefail
v1v marked this conversation as resolved.
Show resolved Hide resolved

#
# Publishes the created artifacts from GoReleaser to AWS as AWS Lambda Layers in every region.
# Finalized by generating an ARN table which will be used in the release notes.
#

export AWS_FOLDER=${AWS_FOLDER:-.aws}
export SUFFIX_ARN_FILE=${SUFFIX_ARN_FILE:-arn-file.md}

GOOS=${GOOS:?Please provide GOOS environment variable.}
GOARCH=${GOARCH:?Please provide GOARCH environment variable.}
ELASTIC_LAYER_NAME=${ELASTIC_LAYER_NAME:?Please provide ELASTIC_LAYER_NAME environment variable.}
ARCHITECTURE=${ARCHITECTURE:?Please provide ARCHITECTURE environment variable.}
VERSION=${VERSION:?Please provide VERSION environment variable. e.g. current git tag}

reakaleek marked this conversation as resolved.
Show resolved Hide resolved
FULL_LAYER_NAME="${ELASTIC_LAYER_NAME}-${ARCHITECTURE}"

ALL_AWS_REGIONS=$(aws ec2 describe-regions --output json --no-cli-pager | jq -r '.Regions[].RegionName')

rm -rf "${AWS_FOLDER}"

# Delete previous layers
for region in $ALL_AWS_REGIONS; do
layer_versions=$(aws lambda list-layer-versions --region="${region}" --layer-name="${FULL_LAYER_NAME}" | jq '.LayerVersions[].Version')
echo "Found layer versions for ${FULL_LAYER_NAME} in ${region}: ${layer_versions:-none}"
for version_number in $layer_versions; do
echo "- Deleting ${FULL_LAYER_NAME}:${version_number} in ${region}"
aws lambda delete-layer-version \
--region="${region}" \
--layer-name="${FULL_LAYER_NAME}" \
--version-number="${version_number}"
done
done

mkdir -p "${AWS_FOLDER}"

zip_file="./dist/${VERSION}-${GOOS}-${GOARCH}.zip"

for region in $ALL_AWS_REGIONS; do
echo "Publish ${FULL_LAYER_NAME} in ${region}"
publish_output=$(aws lambda \
--output json \
publish-layer-version \
--region="${region}" \
--layer-name="${FULL_LAYER_NAME}" \
--compatible-architectures="${ARCHITECTURE}" \
Copy link
Member Author

Choose a reason for hiding this comment

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

Added this so the compatible architecture is visible in the UI.

image

--description="AWS Lambda Extension Layer for Elastic APM ${ARCHITECTURE}" \
--license="Apache-2.0" \
--zip-file="fileb://${zip_file}")
echo "${publish_output}" > "${AWS_FOLDER}/${region}"
layer_version=$(echo "${publish_output}" | jq '.Version')
echo "Grant public layer access ${FULL_LAYER_NAME}:${layer_version} in ${region}"
grant_access_output=$(aws lambda \
--output json \
add-layer-version-permission \
--region="${region}" \
--layer-name="${FULL_LAYER_NAME}" \
--action="lambda:GetLayerVersion" \
--principal='*' \
--statement-id="${FULL_LAYER_NAME}" \
--version-number="${layer_version}")
echo "${grant_access_output}" > "${AWS_FOLDER}/.${region}-public"
done

sh -c "./.ci/create-arn-table.sh"
Loading