-
Notifications
You must be signed in to change notification settings - Fork 35
Jenkins 2 GH Actions Workflow Migration #362
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
Merged
reakaleek
merged 52 commits into
main
from
feature/jenkinsfile-2-gh-actions-workflow-migration
Feb 13, 2023
Merged
Changes from all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
205edaf
Create goreleaser config
reakaleek 496d7bc
Add test workflow
reakaleek ae175a7
Adjust scripts
reakaleek fc84cb2
Adjust scripts for release
reakaleek c875cba
Remove draft flag
reakaleek 483096f
Fix NOTICE.txt rule
reakaleek 503d36d
Remove deprecated files
reakaleek 90a8390
Add smoke test rules again
reakaleek 0a7eefd
Remove outputs
reakaleek fbd2a69
Add slack notification
reakaleek 03751bc
Update .ci/publish-aws.sh
reakaleek b564627
Adjust shebang
reakaleek 88f138d
Use make to the release
reakaleek 37f2b84
Move test command to Makfile
reakaleek ef2f485
Fix build command
reakaleek 7b1c80c
Add opentelemtry workflow
reakaleek f3b775a
Add opencontainers labels
reakaleek b23272a
Use more specific version for vault-action
reakaleek 69f52a5
Fix build test
reakaleek e983461
Run build on a seperate job
reakaleek 2cc8c07
Pin gotestsum version
reakaleek 3875305
Make sure extension file filename is consistent in docker iamge
reakaleek 26ad58d
Add description to scripts
reakaleek 5ac2888
Use env to create docker image tag
reakaleek 43ab35c
Formatting
reakaleek 575766d
Mark PHONY rules
reakaleek 818ba18
Use Make rule for notice.txt
reakaleek e527f43
Move check-licences to Makefile rule
reakaleek 6b3bb5a
Move notice check to Makefile rule
reakaleek b5323fa
Move to Makefile rule
reakaleek 9589f03
Remove excess newlines
reakaleek 66d3978
Use new channel name
reakaleek 02aa3fe
Move to Makefile rule
reakaleek 1333286
Set access and modification times for reproducible builds
reakaleek 71bc0e2
Fix docker build in test
reakaleek 8bd2e43
Use `go run ...` instead of binary
reakaleek ec50ef8
Update .ci/publish-aws.sh
reakaleek b1c1134
Add compatible-architectures metadata
reakaleek 858bd19
Delete zip without custom build_time and rename the zip to the origin…
reakaleek 342f1d1
Merge branch 'main' into feature/jenkinsfile-2-gh-actions-workflow-mi…
reakaleek c9ad1d7
Remove check-extension rule
reakaleek 8975604
Use goreleaser's mtime option to set the buildinfo in archives
reakaleek d15a6b9
Fix Dockerfile
reakaleek ccb7116
Use existing .CommitTimestamp
reakaleek 645fcfd
Set mtime also for files
reakaleek 8dc2d5e
Remove unused SOURCE_DATE_EPOCH
reakaleek 2c52010
Add zip rule
reakaleek 57d1dcb
Refactor
reakaleek a3fc374
Add .PHONY where missing
reakaleek d1b6db3
Failsafe clean rule
reakaleek 2a93275
Update Dockerfile
reakaleek daa0cee
Update Dockerfile
reakaleek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# | ||
# 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}" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
--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" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.