Skip to content

Commit 8911836

Browse files
committed
ci: add script to upload build artifacts to Cloudsmith
Add prepare_artifacts_for_cloudsmith.sh which: - Organizes kernel images and DTBs by architecture/platform - Generates git properties file with branch and commit info - Uploads artifacts to Cloudsmith using wiki-scripts utility - Sets Azure pipeline variables for downstream stages Called from azure-pipelines.yml in the Publish_to_Cloudsmith job. Signed-off-by: Liviu Tomoiaga <[email protected]>
1 parent 07b365b commit 8911836

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

ci/travis/prepare_artifacts_for_cloudsmith.sh

100644100755
Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
1-
# SPDX-License-Identifier: GPL-2.0-only
21
#!/bin/bash -e
2+
# Note: Not using -u because SYSTEM_PULLREQUEST_* vars are unset (not empty) on branch builds.
3+
# Not using -o pipefail because grep returns exit 1 on no match (used in dtb copy loop).
4+
# SPDX-License-Identifier: GPL-2.0-only
5+
#
6+
# Required environment variables:
7+
# SOURCE_DIRECTORY - Directory containing build artifacts (set in azure-pipelines.yml)
8+
# CLOUDSMITH_API_KEY - Cloudsmith API token (secret, passed via env: in pipeline)
9+
#
10+
# Azure DevOps auto-provided variables:
11+
# BUILD_SOURCEVERSION - Commit SHA for the build
12+
# BUILD_SOURCEBRANCH - Full branch ref (e.g., refs/heads/main)
13+
# BUILD_SOURCEBRANCHNAME - Short branch name
14+
#
15+
# PR-only variables (set only for pull request builds):
16+
# SYSTEM_PULLREQUEST_SOURCECOMMITID - PR source commit SHA
17+
# SYSTEM_PULLREQUEST_TARGETBRANCH - PR target branch
18+
# SYSTEM_PULLREQUEST_PULLREQUESTNUMBER - PR number
319

420
TIMESTAMP=$(date +%Y_%m_%d-%H_%M_%S)
521
# For PRs, Azure makes a merge commit (HEAD) because of the shallow copy option
@@ -110,9 +126,12 @@ set_cloudsmith_version_path
110126
# This script is called from azure-pipelines.yml after setting the CLOUDSMITH_API_KEY secret variable
111127
# so we can use it directly here
112128
# Upload to Cloudsmith done using upload_to_cloudsmith.py script from wiki-scripts repo
129+
130+
echo "Uploading artifacts to Cloudsmith repo adi/${CLOUDSMITH_REPO} at path ${SERVER_PATH}/ ..."
131+
113132
python3 ../wiki-scripts/utils/cloudsmith_utils/upload_to_cloudsmith.py \
114133
--repo="${CLOUDSMITH_REPO}" \
115-
--version="${SERVER_PATH}" \
134+
--version="${SERVER_PATH}/" \
116135
--local_path="${TIMESTAMP}" \
117136
--tags="git_sha-${GIT_SHA};timestamp_${TIMESTAMP}" \
118137
--token="${CLOUDSMITH_API_KEY}" \

0 commit comments

Comments
 (0)