-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* [artifacts] Publish release artifacts This adds the publish step to the release pipeline, which uses the release-manager CLI to upload a list Kibana artifacts. * cleanup * add missing artifacts * enable rm * fix syntax * fix artifact * source utils * fix path * fix version * skip steps * re-add pipeline steps * set permissions * Update .buildkite/scripts/steps/artifacts/publish.sh Co-authored-by: Chris <[email protected]> * Revert "Update .buildkite/scripts/steps/artifacts/publish.sh" This reverts commit a6228f5. * export * support version qualifier * setup env * cleanup * consistency * \n * comment * unneccessary fallback * +x * hoist env args * source * link to artifacts * fix artifacts summary * relax docker glob * \n * fix summary * fix variable Co-authored-by: Chris <[email protected]> (cherry picked from commit ab1bec3) Co-authored-by: Jonathan Budzenski <[email protected]>
- Loading branch information
1 parent
4cae03e
commit 3590bd7
Showing
6 changed files
with
141 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
RELEASE_BUILD="${RELEASE_BUILD:="false"}" | ||
VERSION_QUALIFIER="${VERSION_QUALIFIER:=""}" | ||
|
||
BASE_VERSION="$(jq -r '.version' package.json)" | ||
|
||
if [[ "$VERSION_QUALIFIER" == "" ]]; then | ||
QUALIFIER_VERSION="$BASE_VERSION" | ||
else | ||
QUALIFIER_VERSION="$BASE_VERSION-$VERSION_QUALIFIER" | ||
fi | ||
|
||
if [[ "$RELEASE_BUILD" == "true" ]]; then | ||
FULL_VERSION="$QUALIFIER_VERSION" | ||
|
||
# Beats artifacts will need to match a specific commit sha that matches other stack images | ||
# for release builds. For now we are skipping Cloud builds until there's a pointer. | ||
BUILD_ARGS="--release --skip-docker-cloud --version-qualifier=$VERSION_QUALIFIER" | ||
WORKFLOW="staging" | ||
else | ||
FULL_VERSION="$QUALIFIER_VERSION-SNAPSHOT" | ||
BUILD_ARGS="--version-qualifier=$VERSION_QUALIFIER" | ||
WORKFLOW="snapshot" | ||
fi | ||
|
||
export VERSION_QUALIFIER | ||
export BASE_VERSION | ||
export QUALIFIER_VERSION | ||
export FULL_VERSION | ||
export BUILD_ARGS | ||
export WORKFLOW |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
source .buildkite/scripts/common/util.sh | ||
source .buildkite/scripts/steps/artifacts/env.sh | ||
|
||
echo "--- Download and verify artifacts" | ||
function download { | ||
buildkite-agent artifact download "$1" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" | ||
buildkite-agent artifact download "$1.sha512.txt" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" | ||
sha512sum -c "$1.sha512.txt" | ||
rm "$1.sha512.txt" | ||
} | ||
|
||
mkdir -p target | ||
cd target | ||
|
||
download "kibana-$FULL_VERSION-docker-image.tar.gz" | ||
download "kibana-$FULL_VERSION-docker-image-aarch64.tar.gz" | ||
download "kibana-ubi8-$FULL_VERSION-docker-image.tar.gz" | ||
|
||
download "kibana-$FULL_VERSION-arm64.deb" | ||
download "kibana-$FULL_VERSION-amd64.deb" | ||
download "kibana-$FULL_VERSION-x86_64.rpm" | ||
download "kibana-$FULL_VERSION-aarch64.rpm" | ||
|
||
download "kibana-$FULL_VERSION-docker-build-context.tar.gz" | ||
download "kibana-ironbank-$FULL_VERSION-docker-build-context.tar.gz" | ||
download "kibana-ubi8-$FULL_VERSION-docker-build-context.tar.gz" | ||
|
||
download "kibana-$FULL_VERSION-linux-aarch64.tar.gz" | ||
download "kibana-$FULL_VERSION-linux-x86_64.tar.gz" | ||
|
||
download "kibana-$FULL_VERSION-darwin-x86_64.tar.gz" | ||
download "kibana-$FULL_VERSION-darwin-aarch64.tar.gz" | ||
|
||
download "kibana-$FULL_VERSION-windows-x86_64.zip" | ||
|
||
download "dependencies-$FULL_VERSION.csv" | ||
|
||
cd - | ||
|
||
echo "--- Set artifact permissions" | ||
chmod -R a+r target/* | ||
chmod -R a+w target | ||
|
||
echo "--- Pull latest Release Manager CLI" | ||
echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co | ||
trap 'docker logout docker.elastic.co' EXIT | ||
docker pull docker.elastic.co/infra/release-manager:latest | ||
|
||
echo "--- Publish artifacts" | ||
export VAULT_ROLE_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-role-id)" | ||
export VAULT_SECRET_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-secret-id)" | ||
export VAULT_ADDR="https://secrets.elastic.co:8200" | ||
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" \ | ||
--artifact-set main | ||
|
||
ARTIFACTS_SUBDOMAIN="artifacts-$WORKFLOW" | ||
ARTIFACTS_SUMMARY=$(curl -s "https://$ARTIFACTS_SUBDOMAIN.elastic.co/kibana/latest/$FULL_VERSION.json" | jq -re '.summary_url') | ||
|
||
cat << EOF | buildkite-agent annotate --style "info" --context artifacts-summary | ||
### Artifacts Summary | ||
$ARTIFACTS_SUMMARY | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters