-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[artifacts] Publish #129499
Merged
Merged
[artifacts] Publish #129499
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
7a26474
[artifacts] Publish release artifacts
jbudz 0b35909
cleanup
jbudz e812256
add missing artifacts
jbudz 63bf201
enable rm
jbudz 8e9c670
fix syntax
jbudz 148c9de
fix artifact
jbudz f19df7b
source utils
jbudz 04f99e9
fix path
jbudz 24e45c6
fix version
jbudz 57031a1
skip steps
jbudz 56b6fdd
re-add pipeline steps
jbudz 8df0b23
set permissions
jbudz a6228f5
Update .buildkite/scripts/steps/artifacts/publish.sh
jbudz eb271e4
Revert "Update .buildkite/scripts/steps/artifacts/publish.sh"
jbudz 9b39eac
export
jbudz c84c795
Merge branch 'main' into artifacts/release
jbudz 482625d
support version qualifier
jbudz 8fe3099
setup env
jbudz 9cde7a4
cleanup
jbudz 25165df
consistency
jbudz b70d19d
\n
jbudz 87035b4
comment
jbudz 6183eef
unneccessary fallback
jbudz 0b9c997
+x
jbudz 2466e7d
hoist env args
jbudz cf99ad7
source
jbudz 37448ca
link to artifacts
jbudz 82cc0f9
fix artifacts summary
jbudz 338de07
relax docker glob
jbudz c988f4d
\n
jbudz 33250f8
fix summary
jbudz cfb6442
fix variable
jbudz 3809929
Merge branch 'main' into artifacts/release
jbudz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 \ | ||
jbudz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revisiting this in #129650. It was breaking staging builds as is.