mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
[CI] Fix publish script (#188027)
## Summary Another attempt to fix the DRY_RUN-enhanced publish call - as it seems simply emitting the script only works if there are no arguments. Fixes: https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4488#01909cf6-71a4-4608-a830-041af9d781d9 Tested here: https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4490 (the dry-run is supposedly added? but it seems the artifacts were published nonetheless - at least there's no more syntax error) Succesful run with the if-else: https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/4516
This commit is contained in:
parent
5ec5b994dc
commit
9d75f32f42
1 changed files with 36 additions and 24 deletions
|
@ -54,7 +54,7 @@ echo "--- Pull latest Release Manager CLI"
|
|||
docker pull docker.elastic.co/infra/release-manager:latest
|
||||
|
||||
echo "--- Publish artifacts"
|
||||
if [[ "$BUILDKITE_BRANCH" == "$KIBANA_BASE_BRANCH" ]]; then
|
||||
if [[ "$BUILDKITE_BRANCH" == "$KIBANA_BASE_BRANCH" ]] || [[ "${DRY_RUN:-}" =~ ^(1|true)$ ]]; then
|
||||
export VAULT_ROLE_ID="$(get_vault_role_id)"
|
||||
export VAULT_SECRET_ID="$(get_vault_secret_id)"
|
||||
export VAULT_ADDR="https://secrets.elastic.co:8200"
|
||||
|
@ -62,31 +62,43 @@ if [[ "$BUILDKITE_BRANCH" == "$KIBANA_BASE_BRANCH" ]]; then
|
|||
download_artifact beats_manifest.json /tmp --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"
|
||||
export BEATS_MANIFEST_URL=$(jq -r .manifest_url /tmp/beats_manifest.json)
|
||||
|
||||
PUBLISH_CMD=$(cat << EOF
|
||||
docker run --rm \
|
||||
--name release-manager \
|
||||
-e VAULT_ADDR \
|
||||
-e VAULT_ROLE_ID \
|
||||
-e VAULT_SECRET_ID \
|
||||
--mount type=bind,readonly=false,src="$PWD/target",target=/artifacts/target \
|
||||
docker.elastic.co/infra/release-manager:latest \
|
||||
cli collect \
|
||||
--project kibana \
|
||||
--branch "$KIBANA_BASE_BRANCH" \
|
||||
--commit "$GIT_COMMIT" \
|
||||
--workflow "$WORKFLOW" \
|
||||
--version "$BASE_VERSION" \
|
||||
--qualifier "$VERSION_QUALIFIER" \
|
||||
--dependency "beats:$BEATS_MANIFEST_URL" \
|
||||
--artifact-set main
|
||||
EOF
|
||||
)
|
||||
if [[ "${DRY_RUN:-}" =~ ^(1|true)$ ]]; then
|
||||
PUBLISH_CMD+=(" --dry-run")
|
||||
if [[ "$DRY_RUN" =~ ^(1|true)$ ]]; then
|
||||
docker run --rm \
|
||||
--name release-manager \
|
||||
-e VAULT_ADDR \
|
||||
-e VAULT_ROLE_ID \
|
||||
-e VAULT_SECRET_ID \
|
||||
--mount type=bind,readonly=false,src="$PWD/target",target=/artifacts/target \
|
||||
docker.elastic.co/infra/release-manager:latest \
|
||||
cli collect \
|
||||
--project kibana \
|
||||
--branch "$KIBANA_BASE_BRANCH" \
|
||||
--commit "$GIT_COMMIT" \
|
||||
--workflow "$WORKFLOW" \
|
||||
--version "$BASE_VERSION" \
|
||||
--qualifier "$VERSION_QUALIFIER" \
|
||||
--dependency "beats:$BEATS_MANIFEST_URL" \
|
||||
--artifact-set main \
|
||||
--dry-run
|
||||
else
|
||||
docker run --rm \
|
||||
--name release-manager \
|
||||
-e VAULT_ADDR \
|
||||
-e VAULT_ROLE_ID \
|
||||
-e VAULT_SECRET_ID \
|
||||
--mount type=bind,readonly=false,src="$PWD/target",target=/artifacts/target \
|
||||
docker.elastic.co/infra/release-manager:latest \
|
||||
cli collect \
|
||||
--project kibana \
|
||||
--branch "$KIBANA_BASE_BRANCH" \
|
||||
--commit "$GIT_COMMIT" \
|
||||
--workflow "$WORKFLOW" \
|
||||
--version "$BASE_VERSION" \
|
||||
--qualifier "$VERSION_QUALIFIER" \
|
||||
--dependency "beats:$BEATS_MANIFEST_URL" \
|
||||
--artifact-set main
|
||||
fi
|
||||
|
||||
"${PUBLISH_CMD[@]}"
|
||||
|
||||
KIBANA_SUMMARY=$(curl -s "$KIBANA_MANIFEST_LATEST" | jq -re '.summary_url')
|
||||
|
||||
cat << EOF | buildkite-agent annotate --style "info" --context artifacts-summary
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue