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

ci: use updatecli with GitHub secrets #2053

Merged
merged 2 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 4 additions & 6 deletions .ci/updatecli/updatecli.d/update-gherkin-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,20 @@ scms:
default:
kind: github
spec:
user: '{{ requiredEnv "GIT_USER" }}'
email: '{{ requiredEnv "GIT_EMAIL" }}'
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
owner: "{{ .github.owner }}"
repository: "{{ .github.repository }}"
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GIT_USER" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
branch: "{{ .github.branch }}"
apm:
kind: github
spec:
user: '{{ requiredEnv "GIT_USER" }}'
email: '{{ requiredEnv "GIT_EMAIL" }}'
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
owner: "{{ .github.owner }}"
repository: "{{ .github.apm_repository }}"
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GIT_USER" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
branch: "{{ .github.branch }}"

sources:
Expand Down
10 changes: 4 additions & 6 deletions .ci/updatecli/updatecli.d/update-json-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,20 @@ scms:
default:
kind: github
spec:
user: '{{ requiredEnv "GIT_USER" }}'
email: '{{ requiredEnv "GIT_EMAIL" }}'
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
owner: "{{ .github.owner }}"
repository: "{{ .github.repository }}"
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GIT_USER" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
branch: "{{ .github.branch }}"
apm:
kind: github
spec:
user: '{{ requiredEnv "GIT_USER" }}'
email: '{{ requiredEnv "GIT_EMAIL" }}'
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
owner: "{{ .github.owner }}"
repository: "{{ .github.apm_repository }}"
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GIT_USER" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
branch: "{{ .github.branch }}"

sources:
Expand Down
10 changes: 4 additions & 6 deletions .ci/updatecli/updatecli.d/update-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,21 @@ scms:
default:
kind: github
spec:
user: '{{ requiredEnv "GIT_USER" }}'
email: '{{ requiredEnv "GIT_EMAIL" }}'
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
owner: "{{ .github.owner }}"
repository: "{{ .github.repository }}"
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GIT_USER" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
branch: "{{ .github.branch }}"

apm-data:
kind: github
spec:
user: '{{ requiredEnv "GIT_USER" }}'
email: '{{ requiredEnv "GIT_EMAIL" }}'
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
owner: "{{ .github.owner }}"
repository: "{{ .github.apm_data_repository }}"
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GIT_USER" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
branch: "{{ .github.branch }}"

sources:
Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/updatecli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: elastic/apm-pipeline-library/.github/actions/updatecli@current
with:
vaultUrl: ${{ secrets.VAULT_ADDR }}
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
pipeline: .ci/updatecli/updatecli.d
values: .ci/updatecli/values.yml
- if: failure()
uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current

- uses: elastic/oblt-actions/updatecli/run-and-notify@v1
with:
vaultUrl: ${{ secrets.VAULT_ADDR }}
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
slackChannel: "#apm-agent-python"
command: "apply --config .ci/updatecli/updatecli.d --values .ci/updatecli/values.yml"
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to create this secret, I'm working on it

slack-channel-id: "#apm-agent-python"
slack-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>"
slack-send-when: 'failure'
env:
GITHUB_TOKEN: ${{ secrets.UPDATECLI_GH_TOKEN }}
Loading