Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Use relay as extension #5

Merged
merged 8 commits into from
Jun 21, 2022
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The following are all _required_.

## Testing

If you want to see an example of a zip file this action can create looks like you can manually run the GitHub action "Test Production". This will create a dummy lambda layer (just containing one placeholder file) and the latest [relay](https://github.com/getsentry/relay) based Sentry Lambda Extension. After the GitHub action has run, you can download the generated artifact at the bottom of the summary page of the GitHub action result.
If you want to see what an example of a zip file created by this action looks like you can manually run the GitHub action "Test Production". This will create a dummy lambda layer (just containing one placeholder file) and the latest [relay](https://github.com/getsentry/relay) based Sentry Lambda Extension. After the GitHub action has run, you can download the generated artifact at the bottom of the summary page of the GitHub action result.

## Contributing

Expand Down
26 changes: 22 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,32 @@ runs:
with:
path: ${{ inputs.build_cache_paths }}
key: ${{ inputs.build_cache_key }}
- name: "Download and configure Sentry Lambda extension"
- name: Download latest relay
shell: bash
run: |
echo "Downloading Sentry Lambda extension..."
echo "Downloading relay..."
mkdir -p dist-serverless/relay
curl -0 --silent \
--output dist-serverless/relay/relay \
"$(curl -s https://release-registry.services.sentry.io/apps/relay/latest | jq -r .files.\"relay-Linux-x86_64\".url)"
chmod +x dist-serverless/relay/relay
echo "Done downloading relay."
- name: Configure Lambda extension to start relay
shell: bash
run: |
echo "Creating start script..."
mkdir -p dist-serverless/extensions
curl -0 --silent --output dist-serverless/extensions/sentry-lambda-extension `curl -s https://release-registry.services.sentry.io/apps/sentry-lambda-extension/latest | jq -r .files.\"sentry-lambda-extension\".url`
cat > dist-serverless/extensions/sentry-lambda-extension << EOT
#!/bin/bash
set -euo pipefail
exec /opt/relay/relay run \
--mode=proxy \
--shutdown-timeout=2 \
--upstream-dsn="\$SENTRY_DSN" \
--aws-runtime-api="\$AWS_LAMBDA_RUNTIME_API"
EOT
chmod +x dist-serverless/extensions/sentry-lambda-extension
echo "Done downloading Sentry Lambda extension..."
echo "Done creating start script."
- name: "Setup tmate session"
uses: mxschmitt/action-tmate@v3
if: ${{ inputs.debug_enabled == 'true' }}
Expand Down