Skip to content

Commit

Permalink
github-action: run buildkite action with GH secrets (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Jun 4, 2024
1 parent 59992e8 commit f629b1e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 28 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/release-step-3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,24 @@ jobs:
env:
TARBALL_FILE: artifacts.tar
steps:
- id: buildkite
- id: buildkite-run
name: Run Release
uses: elastic/apm-pipeline-library/.github/actions/buildkite@current
uses: elastic/oblt-actions/buildkite/[email protected]
with:
vaultUrl: ${{ secrets.VAULT_ADDR }}
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
pipeline: ecs-logging-java-release
artifactName: releases
artifactPath: ${{ env.TARBALL_FILE }}
waitFor: true
printBuildLogs: false
buildEnvVars: |
token: ${{ secrets.BUILDKITE_TOKEN }}
wait-for: true
env-vars: |
ref=${{ inputs.ref }}
dry_run=${{ inputs.dry_run || 'false' }}
TARBALL_FILE=${{ env.TARBALL_FILE }}
- uses: actions/download-artifact@v3
- uses: elastic/oblt-actions/buildkite/download-artifact@v1.5.0
with:
name: releases
build-number: ${{ steps.buildkite-run.outputs.number }}
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 All @@ -103,15 +101,15 @@ jobs:
subject-path: "${{ github.workspace }}/**/target/*.jar"

- if: ${{ success() }}
uses: elastic/oblt-actions/slack/send@v1.2.0
uses: elastic/oblt-actions/slack/send@v1.5.0
with:
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: "#apm-agent-java"
message: |
:runner: [${{ github.repository }}] Release *${{ github.ref_name }}* has been triggered in Buildkite: (<${{ steps.buildkite.outputs.build }}|build>)
:runner: [${{ github.repository }}] Release *${{ github.ref_name }}* has been triggered in Buildkite: (<${{ steps.buildkite-run.outputs.build }}|build>)
- if: ${{ failure() }}
uses: elastic/oblt-actions/slack/send@v1.2.0
uses: elastic/oblt-actions/slack/send@v1.5.0
with:
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: "#apm-agent-java"
Expand Down
24 changes: 11 additions & 13 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,23 @@ jobs:
env:
TARBALL_FILE: artifacts.tar
steps:
- id: buildkite
- id: buildkite-run
name: Run Deploy
uses: elastic/apm-pipeline-library/.github/actions/buildkite@current
uses: elastic/oblt-actions/buildkite/[email protected]
with:
vaultUrl: ${{ secrets.VAULT_ADDR }}
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
pipeline: ecs-logging-java-snapshot
artifactName: snapshots
artifactPath: ${{ env.TARBALL_FILE }}
waitFor: true
printBuildLogs: false
buildEnvVars: |
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.5.0
with:
name: snapshots
build-number: ${{ steps.buildkite-run.outputs.number }}
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 All @@ -73,7 +71,7 @@ jobs:
subject-path: "${{ github.workspace }}/**/target/*.jar"

- if: ${{ failure() }}
uses: elastic/oblt-actions/slack/send@v1.2.0
uses: elastic/oblt-actions/slack/send@v1.5.0
with:
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: "#apm-agent-java"
Expand Down

0 comments on commit f629b1e

Please sign in to comment.