Skip to content

Commit

Permalink
[8.14] ci: integrate observability deployments with the oblt-test-env (
Browse files Browse the repository at this point in the history
…elastic#181041) (elastic#181451)

# Backport

This will backport the following commits from `main` to `8.14`:
- [ci: integrate observability deployments with the oblt-test-env
(elastic#181041)](elastic#181041)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Victor
Martinez","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-04-23T14:55:36Z","message":"ci:
integrate observability deployments with the oblt-test-env
(elastic#181041)","sha":"3c71d69bf92e152ce05cb46b9210b6f7969f9dd6","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","ci:project-deploy-observability","v8.15.0"],"title":"ci:
integrate observability deployments with the
oblt-test-env","number":181041,"url":"https://github.com/elastic/kibana/pull/181041","mergeCommit":{"message":"ci:
integrate observability deployments with the oblt-test-env
(elastic#181041)","sha":"3c71d69bf92e152ce05cb46b9210b6f7969f9dd6"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/181041","number":181041,"mergeCommit":{"message":"ci:
integrate observability deployments with the oblt-test-env
(elastic#181041)","sha":"3c71d69bf92e152ce05cb46b9210b6f7969f9dd6"}}]}]
BACKPORT-->

Co-authored-by: Victor Martinez <[email protected]>
  • Loading branch information
kibanamachine and v1v authored Apr 23, 2024
1 parent d4f5ddd commit 2fd1496
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
35 changes: 34 additions & 1 deletion .buildkite/scripts/steps/serverless/build_and_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
4 changes: 2 additions & 2 deletions .github/workflows/deploy-my-kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ 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
with:
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
1 change: 0 additions & 1 deletion .github/workflows/oblt-github-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 2fd1496

Please sign in to comment.