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

det-2315/send droppers to s3 #1130

Merged
merged 7 commits into from
Nov 20, 2024
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
60 changes: 60 additions & 0 deletions .github/actions/dropper/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Deploy Dropper
description: Copy dropper source to s3
inputs:
s3_bucket:
description: Where to push probes
required: true
aws_region:
description: Region to set for aws access
required: true
aws_role:
description: AWS Role
slack_notification:
description: Where to send the slack payload

runs:
using: "composite"
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ inputs.aws_region }}
role-to-assume: ${{ inputs.aws_role }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC

- name: Copy files to the s3 with the AWS CLI
shell: bash
run: |

DROPPER_FILES=(src/dropper.go src/go.mod dropper_linux_x86_64.go dropper_linux_arm64.go dropper_darwin_x86_64.go dropper_darwin_arm64.go dropper_windows_x86_64.go go.mod)

for f in ${DROPPER_FILES[@]}; do
src="./go/tests/dropper/${f}"

sha256=`openssl sha256 --binary ${src} | base64`
sha1=`openssl sha1 --binary ${src} | base64`

aws s3api put-object --bucket ${{ inputs.s3_bucket }} --key prelude/dropper/${f} --body $src --metadata "Checksumsha1=${sha1}" --checksum-sha256 ${sha256}
done

- name: Notify Slack
id: slack
if: always()
uses: slackapi/slack-github-action@v1
with:
payload: |
{
"text": "Dropper Deploy (${{ github.triggering_actor }}): ${{ github.ref }} - ${{ github.action_status }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Dropper Deploy (${{ github.triggering_actor }}): ${{ github.ref }} ${{ github.action_status }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ inputs.slack_notification }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
27 changes: 27 additions & 0 deletions .github/workflows/dropper-eu1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: eu1 - Dropper Deploy

on:
workflow_dispatch:

jobs:
build_ubuntu:

runs-on: ubuntu-latest
environment: eu1

name: eu1 - Dropper Deploy

permissions:
id-token: write

steps:
- name: Check out code.
uses: actions/checkout@v4

- id: dropper_composite
uses: ./.github/actions/dropper
with:
s3_bucket: ${{ secrets.BUCKET_NAME }}
aws_region: ${{ secrets.BUCKET_REGION }}
aws_role: ${{ secrets.EU1_S3_ACCOUNT_DEPLOYMENT_ROLE }}
slack_notification: ${{ secrets.EU1_SLACK_URL }}
27 changes: 27 additions & 0 deletions .github/workflows/dropper-us1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: us1 - Dropper Deploy

on:
workflow_dispatch:

jobs:
build_ubuntu:

runs-on: ubuntu-latest
environment: us1

name: us1 - Dropper Deploy

permissions:
id-token: write

steps:
- name: Check out code.
uses: actions/checkout@v4

- id: dropper_composite
uses: ./.github/actions/dropper
with:
s3_bucket: ${{ secrets.BUCKET_NAME }}
aws_region: ${{ secrets.BUCKET_REGION }}
aws_role: ${{ secrets.US1_S3_ACCOUNT_DEPLOYMENT_ROLE }}
slack_notification: ${{ secrets.US1_SLACK_URL }}
27 changes: 27 additions & 0 deletions .github/workflows/dropper-us2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: us2 - Dropper Deploy

on:
workflow_dispatch:

jobs:
build_ubuntu:

runs-on: ubuntu-latest
environment: us2

name: us2 - Dropper Deploy

permissions:
id-token: write

steps:
- name: Check out code.
uses: actions/checkout@v4

- id: dropper_composite
uses: ./.github/actions/dropper
with:
s3_bucket: ${{ secrets.BUCKET_NAME }}
aws_region: ${{ secrets.BUCKET_REGION }}
aws_role: ${{ secrets.US2_S3_ACCOUNT_DEPLOYMENT_ROLE }}
slack_notification: ${{ secrets.US2_SLACK_URL }}