-
Notifications
You must be signed in to change notification settings - Fork 6
Support creating mashes from multiple tags #10
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,10 +5,11 @@ | |
| set -e | ||
| . /etc/profile.d/proxy.sh || : | ||
|
|
||
| KOJI_TAG="${KOJI_TAG:-"$1"}" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is probably a more accurate parameter expansion here. If the service is enabled without a parameter, we want to indicate that this is required and have the script fail. |
||
| BUILD_ARCH="${BUILD_ARCH:-x86_64}" | ||
| KOJI_DIR="${KOJI_DIR:-/srv/koji}" | ||
| MASH_DIR="${MASH_DIR:-/srv/mash}" | ||
| MASH_TRACKER_FILE="$MASH_DIR"/latest-mash-build | ||
| MASH_TRACKER_FILE="$MASH_DIR"/latest-${KOJI_TAG}-build | ||
|
Comment on lines
11
to
+12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I am understanding the intent of the PR correctly, I think we want Then we wouldn't modify |
||
| MASH_TRACKER_DIR="$MASH_DIR"/latest | ||
| MASH_DIR_OLD="$MASH_TRACKER_DIR".old | ||
| MASH_DIR_NEW="$MASH_TRACKER_DIR".new | ||
|
|
@@ -37,18 +38,18 @@ create_dist_repos() { | |
|
|
||
| cp -f "${KOJI_REPO_PATH}/groups/comps.xml" "${comps_file}" | ||
|
|
||
| make_repo "${source_dir}" "${output_dir}" "clear/${BUILD_ARCH}/os" "Packages" "${bin_rpm_paths}" "${comps_file}" & | ||
| make_repo "${source_dir}" "${output_dir}" "clear/${BUILD_ARCH}/debug" "." "${debuginfo_rpm_paths}" & | ||
| make_repo "${source_dir}" "${output_dir}" "clear/source/SRPMS" "." "${src_rpm_paths}" & | ||
| make_repo "${source_dir}" "${output_dir}" "${KOJI_TAG}/${BUILD_ARCH}/os" "Packages" "${bin_rpm_paths}" "${comps_file}" & | ||
| make_repo "${source_dir}" "${output_dir}" "${KOJI_TAG}/${BUILD_ARCH}/debug" "." "${debuginfo_rpm_paths}" & | ||
| make_repo "${source_dir}" "${output_dir}" "${KOJI_TAG}/source/SRPMS" "." "${src_rpm_paths}" & | ||
| wait | ||
|
|
||
| create_dnf_conf "${work_dir}/dnf-os.conf" "${output_dir}/clear/${BUILD_ARCH}/os" clear-os | ||
| create_dnf_conf "${work_dir}/dnf-debug.conf" "${output_dir}/clear/${BUILD_ARCH}/debug" clear-debug | ||
| create_dnf_conf "${work_dir}/dnf-SRPMS.conf" "${output_dir}/clear/source/SRPMS" clear-SRPMS | ||
| create_dnf_conf "${work_dir}/dnf-os.conf" "${output_dir}/${KOJI_TAG}/${BUILD_ARCH}/os" clear-os | ||
| create_dnf_conf "${work_dir}/dnf-debug.conf" "${output_dir}/${KOJI_TAG}/${BUILD_ARCH}/debug" clear-debug | ||
| create_dnf_conf "${work_dir}/dnf-SRPMS.conf" "${output_dir}/${KOJI_TAG}/source/SRPMS" clear-SRPMS | ||
|
|
||
| write_packages_file "${work_dir}/dnf-os.conf" "$output_dir/clear/$BUILD_ARCH/packages-os" | ||
| write_packages_file "${work_dir}/dnf-debug.conf" "$output_dir/clear/$BUILD_ARCH/packages-debug" | ||
| write_packages_file "${work_dir}/dnf-SRPMS.conf" "$output_dir/clear/source/packages-SRPMS" | ||
| write_packages_file "${work_dir}/dnf-os.conf" "$output_dir/${KOJI_TAG}/$BUILD_ARCH/packages-os" | ||
| write_packages_file "${work_dir}/dnf-debug.conf" "$output_dir/${KOJI_TAG}/$BUILD_ARCH/packages-debug" | ||
| write_packages_file "${work_dir}/dnf-SRPMS.conf" "$output_dir/${KOJI_TAG}/source/packages-SRPMS" | ||
|
Comment on lines
-40
to
+52
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For these function calls, we unfortunately need to keep the |
||
|
|
||
| rm -rf "${work_dir}" | ||
| } | ||
|
|
@@ -99,18 +100,20 @@ if [[ -e "$MASH_TRACKER_FILE" ]]; then | |
| else | ||
| MASH_BUILD_NUM=0 | ||
| fi | ||
| KOJI_TAG="${KOJI_TAG:-"dist-clear"}" | ||
| KOJI_REPO_PATH="$(realpath "$KOJI_DIR/repos/$KOJI_TAG-build/latest")" | ||
| KOJI_BUILD_NUM="$(basename "$KOJI_REPO_PATH")" | ||
| if [[ "$MASH_BUILD_NUM" -ne "$KOJI_BUILD_NUM" ]]; then | ||
| rm -rf "$MASH_DIR_NEW" | ||
| mkdir -p "$MASH_DIR_NEW" | ||
| create_dist_repos "$MASH_TRACKER_DIR" "$MASH_DIR_NEW" | ||
| if [[ -e "$MASH_TRACKER_DIR" ]]; then | ||
| mv "$MASH_TRACKER_DIR" "$MASH_DIR_OLD" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah yes! i will update that and $MASH_TRACKER_DIR! |
||
| if [[ -e "$MASH_TRACKER_DIR/$KOJI_TAG" ]]; then | ||
| mkdir -p "$MASH_DIR_OLD" | ||
| mv "$MASH_TRACKER_DIR/$KOJI_TAG" "$MASH_DIR_OLD/$KOJI_TAG" | ||
| fi | ||
| mv "$MASH_DIR_NEW" "$MASH_TRACKER_DIR" | ||
| mkdir -p "$MASH_TRACKER_DIR" | ||
| mv "$MASH_DIR_NEW/$KOJI_TAG" "$MASH_TRACKER_DIR" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly with |
||
| rm -rf "$MASH_DIR_OLD" | ||
| rm -rf "$MASH_DIR_NEW" | ||
|
Comment on lines
-109
to
+116
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think with the change to the root folder, none of these changes are needed? |
||
|
|
||
| echo "$KOJI_BUILD_NUM" > "$MASH_TRACKER_FILE" | ||
| fi | ||
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.
I think for a case like this, we want the service file on disk to be named
[email protected]to indicate to systemd that we want to pass a parameter, but not hard-code the parameter for all instantiations of the service.