Skip to content

Commit

Permalink
chore(apps/prod/tekton/configs/tasks): update task `publish-tiup-from…
Browse files Browse the repository at this point in the history
…-oci-artifact` (#1024)

Ref: PingCAP-QE/artifacts#274
Signed-off-by: wuhuizuo <wuhuizuo@126.com>

Signed-off-by: wuhuizuo <wuhuizuo@126.com>
  • Loading branch information
wuhuizuo authored Mar 12, 2024
1 parent b770565 commit 3af78de
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
# fetch artifact config
oras manifest fetch-config "$(params.artifact-url)" > artifact-config.json
if yq -e -oy '.tiup | length == 0' artifact-config.json; then
if yq -e -oy '.["net.pingcap.tibuild.tiup"] | length == 0' artifact-config.json; then
echo "No tiup pacakges are need to published."
exit 0
fi
Expand All @@ -41,7 +41,7 @@ spec:
# publish the tiup packages
:> publish.sh
tiup_last_index=$(yq --output-format=yaml '.tiup | length - 1' artifact-config.json)
tiup_last_index=$(yq --output-format=yaml '.["net.pingcap.tibuild.tiup"] | length - 1' artifact-config.json)
os="$(yq --output-format=yaml '.os' artifact-config.json)"
architecture="$(yq --output-format=yaml '.architecture' artifact-config.json)"
version="$(yq --output-format=yaml '.version' artifact-config.json)"
Expand All @@ -52,13 +52,13 @@ spec:
fi
for i in `seq 0 $tiup_last_index`; do
pkg_file="$(yq --output-format=yaml .tiup[$i].file artifact-config.json)"
pkg_file="$(yq --output-format=yaml .["net.pingcap.tibuild.tiup"][$i].file artifact-config.json)"
pkg_name=$(echo "$pkg_file" | sed -E "s/-v[0-9]+.+//")
entrypoint="$(yq --output-format=yaml .tiup[$i].entrypoint artifact-config.json)"
desc="$(yq --output-format=yaml .tiup[$i].description artifact-config.json)"
entrypoint="$(yq --output-format=yaml .["net.pingcap.tibuild.tiup"][$i].entrypoint artifact-config.json)"
desc="$(yq --output-format=yaml .["net.pingcap.tibuild.tiup"][$i].description artifact-config.json)"
# tiup mirror publish <comp-name> <version> <tarball> <entry> [flags]
if yq -e -oy ".tiup[$i].standalone" artifact-config.json; then
if yq -e -oy ".["net.pingcap.tibuild.tiup"][$i].standalone" artifact-config.json; then
printf 'tiup mirror publish %s %s %s %s --os %s --arch %s --standalone --desc "%s"\n' \
$pkg_name $version $pkg_file $entrypoint $os $architecture "$desc" \
>> publish.sh
Expand Down

0 comments on commit 3af78de

Please sign in to comment.