Skip to content

Commit

Permalink
ci: use oblt-actions (slack and buildkite) and ruby github secrets (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Jun 10, 2024
1 parent f4d928d commit dd21c84
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 38 deletions.
31 changes: 7 additions & 24 deletions .github/workflows/microbenchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,16 @@ permissions:
jobs:
microbenchmark:
runs-on: ubuntu-latest
# wait up to 1 hour
timeout-minutes: 60
timeout-minutes: 5
steps:
- id: buildkite
name: Run buildkite pipeline
uses: elastic/apm-pipeline-library/.github/actions/buildkite@current
- name: Run microbenchmark
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-microbenchmark
triggerMessage: "${{ github.repository }}@${{ github.ref_name }}"
waitFor: true
printBuildLogs: true
buildEnvVars: |
pipeline: "apm-agent-microbenchmark"
token: ${{ secrets.BUILDKITE_TOKEN }}
wait-for: false
env-vars: |
script=.ci/scripts/bench.sh
repo=apm-agent-ruby
sha=${{ github.sha }}
BRANCH_NAME=${{ github.ref_name }}
- if: ${{ failure() }}
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
with:
url: ${{ secrets.VAULT_ADDR }}
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
channel: "#apm-agent-ruby"
message: |
:ghost: [${{ github.repository }}] microbenchmark *${{ github.ref_name }}* failed to run in Buildkite.
Build: (<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>)
19 changes: 5 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,13 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- uses: hashicorp/[email protected]
with:
url: ${{ secrets.VAULT_ADDR }}
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
secret/apm-team/ci/apm-agent-ruby-rubygems-release apiKey | API_KEY ;
- name: RubyGems login
run: |
RUBY_HOME="${HOME}/.gem"
RUBY_CREDENTIALS_FILE="${RUBY_HOME}/credentials"
mkdir -p "${RUBY_HOME}"
echo '---' > "${RUBY_CREDENTIALS_FILE}"
echo ":rubygems_api_key: ${API_KEY}" >> "${RUBY_CREDENTIALS_FILE}"
echo ":rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}" >> "${RUBY_CREDENTIALS_FILE}"
chmod 0600 "${RUBY_CREDENTIALS_FILE}"
- name: Install build system
Expand Down Expand Up @@ -87,9 +79,8 @@ jobs:
needs: ${{ toJSON(needs) }}
- run: ${{ steps.check.outputs.isSuccess }}
- if: ${{ always() && startsWith(github.ref, 'refs/tags') }}
uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current
uses: elastic/oblt-actions/slack/notify-result@v1
with:
vaultUrl: ${{ secrets.VAULT_ADDR }}
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
slackChannel: "#apm-agent-ruby"
bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
channel-id: "#apm-agent-ruby"
message: ":traffic_cone: updatecli failed for `${{ github.repository }}@${{ github.ref_name }}`, @robots-ci please look what's going on <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"

0 comments on commit dd21c84

Please sign in to comment.