Skip to content
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

feat: move mirror ci to publish step #367

Merged
merged 7 commits into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions templates/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ spec:
default: ""
team:
default: uds
mirror:
default: "true"
mirror-project-id:
default: ${MIRROR_PROJECT_ID}
---
publish:
variables:
Expand Down Expand Up @@ -84,6 +88,24 @@ publish:

UDS_USE_CHECKPOINT=false uds run $TASK_NAME "${ARGS[@]}" ${OPTIONS}

# TODO: @corang - this will be removed upon deployment of uds registry
# Mirror package to github
- |
if [[ "$[[ inputs.mirror ]]" == "true" ]]; then
export PKG_VERSION="$(uds-releaser show $[[ inputs.flavor ]] --version-only)"
export PKG_NAME="$(yq '.metadata.name' zarf.yaml)"
curl -sS --request POST \
--form "token=${CI_JOB_TOKEN}" \
--form "variables[VERSION]=${PKG_VERSION}" \
--form "variables[PROJECT_NAME]=${CI_PROJECT_NAME}" \
--form "variables[PROJECT_NAMESPACE]=${CI_PROJECT_NAMESPACE}" \
--form "variables[PACKAGE_NAME]=${PKG_NAME}" \
--form "variables[FLAVOR]=$[[ inputs.flavor ]]" \
--form "variables[ARCH]=${arch}" \
--form ref=main "${CI_API_V4_URL}/projects/$[[ inputs.mirror-project-id ]]/trigger/pipeline"
fi


after_script:
# Save logs, which will run even if the script section fails
- echo -e "\e[0Ksection_start:`date +%s`:afterscript_section[collapsed=true]\r\e[0KAfter Script Output"
Expand Down
Loading