ci: integrate observability deployments with the oblt-test-env (#181041)

This commit is contained in:
Victor Martinez 2024-04-23 16:55:36 +02:00 committed by GitHub
parent 9e8a25c902
commit 3c71d69bf9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 36 additions and 4 deletions

View file

@ -137,8 +137,41 @@ EOF
buildkite-agent meta-data set pr_comment:early_comment_job_id "$BUILDKITE_JOB_ID"
}
# This is the integration with the observability-test-environments
create_github_issue_oblt_test_environments() {
echo "--- Create GitHub issue for deploying in the oblt test env"
GITHUB_ISSUE=$(mktemp --suffix ".md")
cat <<EOF > "$GITHUB_ISSUE"
### Kibana image
$KIBANA_IMAGE
### Kibana pull request
$BUILDKITE_PULL_REQUEST
### Further details
Caused by @$GITHUB_PR_TRIGGER_USER using the github label in https://github.com/elastic/kibana/pull/$BUILDKITE_PULL_REQUEST
EOF
GH_TOKEN="$GITHUB_TOKEN" \
gh issue create \
--title "[Deploy Serverless Kibana] for user $GITHUB_PR_TRIGGER_USER with PR kibana@pr-$BUILDKITE_PULL_REQUEST" \
--body-file "${GITHUB_ISSUE}" \
--label 'deploy-custom-kibana-serverless' \
--repo 'elastic/observability-test-environments' \
--assignee "$GITHUB_PR_OWNER"
}
is_pr_with_label "ci:project-deploy-elasticsearch" && deploy "elasticsearch"
is_pr_with_label "ci:project-deploy-observability" && deploy "observability"
if is_pr_with_label "ci:project-deploy-observability" ; then
create_github_issue_oblt_test_environments
echo "--- Deploy observability with Kibana CI"
deploy "observability"
fi
is_pr_with_label "ci:project-deploy-security" && deploy "security"
exit 0;

View file

@ -20,7 +20,7 @@ permissions:
jobs:
deploy-my-kibana:
if: ${{ github.event.issue.pull_request && (github.event.comment.body == '/oblt-deploy' || github.event.comment.body == '/oblt-deploy-serverless') }}
if: ${{ github.event.issue.pull_request && github.event.comment.body == '/oblt-deploy' }}
runs-on: ubuntu-latest
steps:
- uses: elastic/apm-pipeline-library/.github/actions/deploy-my-kibana@current
@ -28,4 +28,4 @@ jobs:
vaultUrl: ${{ secrets.OBLT_VAULT_ADDR }}
vaultRoleId: ${{ secrets.OBLT_VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.OBLT_VAULT_SECRET_ID }}
serverless: ${{ github.event.comment.body == '/oblt-deploy-serverless' }}
serverless: false

View file

@ -50,7 +50,6 @@ jobs:
Just comment with:
- \`/oblt-deploy\` : Deploy a Kibana instance using the Observability test environments.
- \`/oblt-deploy-serverless\` : Deploy a serverless Kibana instance using the Observability test environments.
- \`run\` \`elasticsearch-ci/docs\` : Re-trigger the docs validation. (use unformatted text in the comment!)
</p>