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

github-actions: use buildkite and slack bot GH secrets #3679

Merged
merged 1 commit into from
Jun 13, 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
33 changes: 14 additions & 19 deletions .github/workflows/release-step-3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,26 +81,23 @@ jobs:
env:
TARBALL_FILE: artifacts.tar
steps:
- id: buildkite
- id: buildkite-run
continue-on-error: true
name: Run Deploy
uses: elastic/apm-pipeline-library/.github/actions/buildkite@current
uses: elastic/oblt-actions/buildkite/run@v1
with:
vaultUrl: ${{ secrets.VAULT_ADDR }}
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
pipeline: apm-agent-java-release
waitFor: true
printBuildLogs: false
artifactName: releases
artifactPath: ${{ env.TARBALL_FILE }}
buildEnvVars: |
pipeline: "apm-agent-java-release"
token: ${{ secrets.BUILDKITE_TOKEN }}
wait-for: true
env-vars: |
dry_run=${{ inputs.dry_run || 'false' }}
TARBALL_FILE=${{ env.TARBALL_FILE }}

- uses: actions/download-artifact@v3
- uses: elastic/oblt-actions/buildkite/download-artifact@v1
with:
name: releases
build-number: ${{ steps.buildkite-run.outputs.build }}
path: "${{ env.TARBALL_FILE }}"
pipeline: ${{ steps.buildkite-run.outputs.pipeline }}
token: ${{ secrets.BUILDKITE_TOKEN }}

- name: untar the buildkite tarball
run: tar xvf ${{ env.TARBALL_FILE }}
Expand Down Expand Up @@ -287,10 +284,8 @@ jobs:
uses: elastic/apm-pipeline-library/.github/actions/check-dependent-jobs@current
with:
needs: ${{ toJSON(needs) }}
- uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current
- uses: elastic/oblt-actions/slack/notify-result@v1
with:
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: "#apm-agent-java"
status: ${{ steps.check.outputs.status }}
vaultUrl: ${{ secrets.VAULT_ADDR }}
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
slackChannel: "#apm-agent-java"
36 changes: 16 additions & 20 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,24 @@ jobs:
TARBALL_FILE: artifacts.tar
if: ${{ contains(needs.validate.outputs.is-snapshot, 'true') }}
steps:
- id: buildkite
name: Run Deploy
uses: elastic/apm-pipeline-library/.github/actions/buildkite@current
- id: buildkite-run
continue-on-error: true
uses: elastic/oblt-actions/buildkite/run@v1
with:
vaultUrl: ${{ secrets.VAULT_ADDR }}
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
pipeline: apm-agent-java-snapshot
pipelineBranch: ${{ github.ref_name }}
artifactName: snapshots
artifactPath: ${{ env.TARBALL_FILE }}
waitFor: true
printBuildLogs: false
buildEnvVars: |
branch: ${{ github.ref_name }}
pipeline: "apm-agent-java-snapshot"
token: ${{ secrets.BUILDKITE_TOKEN }}
wait-for: true
env-vars: |
dry_run=${{ inputs.dry_run || 'false' }}
TARBALL_FILE=${{ env.TARBALL_FILE }}

- uses: actions/download-artifact@v3
- uses: elastic/oblt-actions/buildkite/download-artifact@v1
with:
name: snapshots
build-number: ${{ steps.buildkite-run.outputs.build }}
path: "${{ env.TARBALL_FILE }}"
pipeline: ${{ steps.buildkite-run.outputs.pipeline }}
token: ${{ secrets.BUILDKITE_TOKEN }}

- name: untar the buildkite tarball
run: tar xvf ${{ env.TARBALL_FILE }}
Expand Down Expand Up @@ -108,12 +106,10 @@ jobs:
with:
needs: ${{ toJSON(needs) }}
- if: ${{ failure() && ! inputs.dry_run }}
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
uses: elastic/oblt-actions/slack/send@v1
with:
url: ${{ secrets.VAULT_ADDR }}
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
channel: "#apm-agent-java"
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: "#apm-agent-java"
message: |
:ghost: [${{ github.repository }}] Snapshot *${{ github.ref_name }}* didn't get triggered in Buildkite.
Build: (<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>)
Loading