From cfee7fd08fa425ae64169097e884342c377e9ae6 Mon Sep 17 00:00:00 2001 From: Lubos Kocman Date: Thu, 4 Aug 2022 14:31:10 +0200 Subject: [PATCH 1/8] Move publish_distro 817e024 into openSUSE-release-tools https://github.com/openSUSE/publish_distro/issues/13 --- publish_distro | 273 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 273 insertions(+) create mode 100755 publish_distro diff --git a/publish_distro b/publish_distro new file mode 100755 index 00000000..4dcfe6de --- /dev/null +++ b/publish_distro @@ -0,0 +1,273 @@ +#!/bin/bash + +# from stage (/src/ftp-stage) to public (/srv/ftp) + +# no --delete built in + +# number of hours to delay publishing when new isos arrive +PUBLISH_DELAY=2 + +# force publish even if isos appear to be synced already +force= + +# used for cleanup +date='now' + +# set to echo for dry run +dryrun= + +# cleanup instead of sync +do_cleanup= + +# url with snapshot changes app +diff_url_base="https://openqa.opensuse.org/snapshot-changes/opensuse" +changes_dir_base="/srv/www-local/snapshot-changes" +repos=("oss" "non-oss") +extra_repos=("source" "debug") +isodir="iso" + +get_version() { + exit 1 +} +get_iso() { + exit 1 +} +get_iso_link() { + exit 1 +} +get_diff_url() { + exit 1 +} +get_mark_published_url() { + exit 1 +} +get_changes_filename() { + exit 1 +} + +# --dry and --cleanup should not be passed to rsync through $@ +# config file and possibly other opts including --force need to be +for arg do + shift + if [ "$arg" == '--force' ]; then + force=1 + newargs+=("$arg") + shift + continue + elif [ "$arg" == '--dry' ]; then + dryrun=echo + shift + continue + elif [ "$arg" == '--cleanup' ]; then + do_cleanup=1 + date="90 days ago" + continue + else + newargs+=("$arg") + fi +done + +# set newargs as $@ +set -- "${newargs[@]}" + +. "$1" || { echo "need to specify config file" >&2; exit 1; } +shift + +stage="/srv/ftp-stage/pub/opensuse/$path" +dest="/srv/ftp/pub/opensuse/$path" + +if [ ! -e "$stage" -o ! -e "$dest" ]; then + echo "stage ($stage) and/or dest ($dest) doesn't exist" >&2 + exit 1 +fi + +if [ -n "$do_cleanup" ]; then + # find newest delete log of that day + deletelog=$(ls -1tr ${deletelog%/*}/*-deletes.log | tail -1) + test -n "$deletelog" || exit 1 + ( + df -h /srv + for i in $(awk '/\*deleting .*/ { print $2}' $deletelog ); do + if [ -e "$stage/$i" ]; then + echo "WARNING: $i still exist in stage, not deleting" + else + $dryrun rm -rvf "$dest/$i" + fi + done + df -h /srv + ) > $deletelog-deleted + exit 0 +fi + +mkdir -p "${synclog%/*}" "${deletelog%/*}" +if test -f $synclog; then + old $synclog +fi +if test -f $deletelog; then + old $deletelog +fi + +version= +do_sync_isos=1 +for flavor in "${flavors[@]}"; do + get_version + + get_iso + + get_diff_url + get_changes_filename + if [ -z "$force" -a -e "$dest/$isodir/$iso" ]; then + if [ -t 1 ]; then # only log to tty + echo "$iso already published, skipping isos" + fi + do_sync_isos=0 + break + fi + if [ -n "$changes" ]; then + if [ -d "$stage/$changes" ]; then + # new way, use the obs generated changelogs + $dryrun rsync -avvhiH $stage/$changes \ + --link-dest=$stage \ + $dest/$changes $dry_delete "$@" \ + | LC_ALL=C grep -v '^\.[fdL] ' \ + | LC_ALL=C grep -v '^\(sending\|delta\)' \ + | tee -a $log + else + # old way (already broken?) + if [ ! -s "$changes" ]; then + echo "generating $changes" | tee -a $synclog + [ -z "$dryrun" ] || changes=/dev/stdout + $dryrun curl -sf "$url" > $changes + fi + if [ ! -e $stage/$isodir/$changes ]; then + $dryrun cp -v $changes $stage/$isodir | tee -a $synclog + [ -e $stage/$isodir/Changes ] || $dryrun ln -sf . $stage/$isodir/Changes 2>&1 | tee -a $synclog + fi + fi + fi + if [ ! -e "$stage/$isodir/$iso" ]; then + echo "$flavor with $version doesn't exist, skipping isos" | tee -a $synclog + do_sync_isos=0 + break + else + get_iso_link + if [ "`readlink $link`" != "$iso" ]; then + $dryrun ln -sf "$iso" "$link" + $dryrun ln -sf "$iso.sha256" "$link.sha256" + fi + if [ -z "$force" ]; then + if test `date -d "$PUBLISH_DELAY hours ago" +%s` -lt `stat -c "%Z" "$stage/$isodir/$iso"`; then + echo "$iso was created less than $PUBLISH_DELAY hours ago, delay publishing" | tee -a $synclog + do_sync_isos=0 + fi + fi + fi +done + +# produce directories stamped with build number +for r in "${repos[@]/#//repo/}"; do + for i in /suse/setup /boot; do + d="$stage$r$i" + [ -d "$d" ] || continue + if [ -e "$stage$r/media.1/build" ]; then + read build < "$stage$r/media.1/build" + stamp="${build#*Build}" + if [ "$build" = "$stamp" ]; then + echo "ERROR: build id not parsable: $build. not syncing" + do_sync_isos=0 + break 2 + fi + elif [ -e "$stage$r/media.1/media" ]; then + { read dummy; read build; } < "$stage$r/media.1/media" + stamp="${build#*Build}" + if [ "$build" = "$stamp" ]; then + echo "ERROR: build id not parsable: $build. not syncing" + do_sync_isos=0 + break 2 + fi + else + echo "ERROR: repo $r is missing build id, not syncing" + do_sync_isos=0 + break 2 + fi + stamped="$stage$r${i%/*}/$stamp-${i##*/}" + if [ ! -L "$d" ]; then + $dryrun mv "$d" "$stamped" + $dryrun ln -s "${stamped##*/}" "$d" + echo "current $stamp" | $dryrun tee $stage/$r/.current.txt + fi + done +done + +if [ "$do_sync_isos" = 0 ]; then + if [ -t 1 ]; then + echo "nothing to do" + fi + exit 0 +fi + +# scan mirrors before making the files visible +#mb scan -q -a -d /tumbleweed + +TODO=() +#if [ "$do_sync_isos" = 1 ]; then + TODO+=(iso) + echo "current $version" | $dryrun tee $stage/$isodir/.current.txt +#fi + +if [ -n "$repos" ]; then + TODO+=(repo) + TODO+=(DELETE_repo) +fi + +# a single grep -v regexp performs awfully bad (needs at least 30x so long) +# although LC_ALL=C might fix this, too +for i in "${TODO[@]}"; do + + case $i in + DELETE_*) + i=${i#DELETE_} + log=$deletelog + dry_delete="--delete -n" + ;; + iso) # ISOs we sync with delete + log=$synclog + dry_delete="--delete-after" + i="$isodir" + ;; + *) + log=$synclog + dry_delete="" + ;; + esac + + echo ========== $i $dry_delete =========== + $dryrun rsync -avvhiH $stage/$i \ + --link-dest=$stage \ + $dest $dry_delete "$@" \ + | LC_ALL=C grep -v '^\.[fdL] ' \ + | LC_ALL=C grep -v '^\(sending\|delta\)' \ + | tee -a $log +done + +# also sync source and debug, not bind mounted for Leap +for r in "${extra_repos[@]}"; do + stage="/srv/ftp-stage/pub/opensuse/$r/$path" + dest="/srv/ftp/pub/opensuse/$r/$path" + $dryrun rsync -avhiH $stage/ --link-dest=$stage \ + $dest --delete-after "$@" | tee -a log +done + +# mark published +get_mark_published_url +if [ -n "$url" ]; then + $dryrun curl -X POST -F "version=$version" "$url" +fi + +echo creating hashes +#metalink-hasher update -t /srv/metalink-hashes/srv/ftp/pub/opensuse/tumbleweed \ +# -b /srv/ftp/pub/opensuse/tumbleweed \ +# /srv/ftp/pub/opensuse/tumbleweed +$dryrun /usr/bin/mb makehashes -b /srv/ftp/pub/opensuse \ + -t /srv/metalink-hashes/srv/ftp/pub/opensuse \ + $dest From b8c8911fcd3a73252f433b0eaad57e8fa9e48707 Mon Sep 17 00:00:00 2001 From: Lubos Kocman Date: Thu, 4 Aug 2022 15:54:21 +0200 Subject: [PATCH 2/8] Add short summary to publish_distro --- CONTENTS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTENTS.md b/CONTENTS.md index 9709c4e9..03fa8aa0 100644 --- a/CONTENTS.md +++ b/CONTENTS.md @@ -19,6 +19,8 @@ Apart from these tools, the repository includes: * [GoCD](https://www.gocd.org) configuration files in [gocd](gocd). GoCD is an open source CI/CD server that is used to deploy the bots on OBS. * Several [systemd](systemd) units: the Metrics instance makes use of them. +* publish_distro tool and related configuration in publish_distro + to rsync content from OBS to ftp-stage/ftp-prod on pontifex host ## Tools From 132f68ff511cf0a7c9f4636f2e88336e77cad0c5 Mon Sep 17 00:00:00 2001 From: Lubos Kocman Date: Thu, 4 Aug 2022 16:07:03 +0200 Subject: [PATCH 3/8] Add basic docs to the script --- publish_distro | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/publish_distro b/publish_distro index 4dcfe6de..29a8b9b8 100755 --- a/publish_distro +++ b/publish_distro @@ -1,6 +1,14 @@ #!/bin/bash -# from stage (/src/ftp-stage) to public (/srv/ftp) +# +# The script is executed periodically by cronjob +# as part of ~mirror/bin/publish_factory_leap wrapper on pontifex +# +# Tool publises data from stage (/src/ftp-stage) to public (/srv/ftp - download.opensuse.org) +# +# Configuration lives in openSUSE-release-tools.git/publish_distro_conf +# Syntax: ./publish_distro config_file +# # no --delete built in From 420ade7f0f728a9e59335e5562fcff691dde3740 Mon Sep 17 00:00:00 2001 From: Lubos Kocman Date: Thu, 4 Aug 2022 16:08:26 +0200 Subject: [PATCH 4/8] Copy of publish_distro configuration 817e024 --- .../publish_leap-micro52.config | 50 +++++++++++++++ .../publish_leap-micro52_appliances.config | 58 +++++++++++++++++ .../publish_leap-micro53.config | 50 +++++++++++++++ .../publish_leap-micro53_appliances.config | 58 +++++++++++++++++ .../publish_leap150_jeos.config | 61 ++++++++++++++++++ .../publish_leap150_live.config | 49 +++++++++++++++ publish_distro_conf/publish_leap151.config | 46 ++++++++++++++ .../publish_leap151_jeos.config | 61 ++++++++++++++++++ .../publish_leap151_live.config | 49 +++++++++++++++ publish_distro_conf/publish_leap152.config | 46 ++++++++++++++ .../publish_leap152_jeos.config | 61 ++++++++++++++++++ .../publish_leap152_live.config | 49 +++++++++++++++ publish_distro_conf/publish_leap153.config | 51 +++++++++++++++ .../publish_leap153_appliances.config | 62 ++++++++++++++++++ .../publish_leap153_live.config | 49 +++++++++++++++ publish_distro_conf/publish_leap154.config | 51 +++++++++++++++ .../publish_leap154_appliances.config | 63 +++++++++++++++++++ .../publish_leap154_live.config | 49 +++++++++++++++ publish_distro_conf/publish_leap155.config | 51 +++++++++++++++ .../publish_leap155_appliances.config | 63 +++++++++++++++++++ .../publish_leap155_live.config | 49 +++++++++++++++ publish_distro_conf/publish_tumbleweed.config | 47 ++++++++++++++ 22 files changed, 1173 insertions(+) create mode 100644 publish_distro_conf/publish_leap-micro52.config create mode 100644 publish_distro_conf/publish_leap-micro52_appliances.config create mode 100644 publish_distro_conf/publish_leap-micro53.config create mode 100644 publish_distro_conf/publish_leap-micro53_appliances.config create mode 100644 publish_distro_conf/publish_leap150_jeos.config create mode 100644 publish_distro_conf/publish_leap150_live.config create mode 100644 publish_distro_conf/publish_leap151.config create mode 100644 publish_distro_conf/publish_leap151_jeos.config create mode 100644 publish_distro_conf/publish_leap151_live.config create mode 100644 publish_distro_conf/publish_leap152.config create mode 100644 publish_distro_conf/publish_leap152_jeos.config create mode 100644 publish_distro_conf/publish_leap152_live.config create mode 100644 publish_distro_conf/publish_leap153.config create mode 100644 publish_distro_conf/publish_leap153_appliances.config create mode 100644 publish_distro_conf/publish_leap153_live.config create mode 100644 publish_distro_conf/publish_leap154.config create mode 100644 publish_distro_conf/publish_leap154_appliances.config create mode 100644 publish_distro_conf/publish_leap154_live.config create mode 100644 publish_distro_conf/publish_leap155.config create mode 100644 publish_distro_conf/publish_leap155_appliances.config create mode 100644 publish_distro_conf/publish_leap155_live.config create mode 100644 publish_distro_conf/publish_tumbleweed.config diff --git a/publish_distro_conf/publish_leap-micro52.config b/publish_distro_conf/publish_leap-micro52.config new file mode 100644 index 00000000..bb410c1b --- /dev/null +++ b/publish_distro_conf/publish_leap-micro52.config @@ -0,0 +1,50 @@ +# vim:syntax=sh + +micro_version=5.2 +qu="" # empty string for GA, QuarterlyUpdate repins have -N in version +logfile_base=~/publish_logs/$micro_version/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap-micro/$micro_version/product" +flavors=(DVD-x86_64 DVD-aarch64) + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/iso/openSUSE-Leap-Micro-$micro_version$qu-$flavor-Build[0123456789]*.[0123456789]*-Media.iso` + version=${version##*Build} + version=${version%-*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +get_iso() +{ + iso="openSUSE-Leap-Micro-$micro_version$qu-$flavor-Build$version-Media.iso" +} + +get_iso_link() +{ + link="$stage/iso/openSUSE-Leap-$micro_version$qu-$flavor-Current.iso" +} + +get_diff_url() +{ + url="$diff_url_base/$micro_version/diff/$version" +} + +get_mark_published_url() +{ + url="$diff_url_base/$micro_version/current" +} + +get_changes_filename() +{ + # ChangeLog files from obsgendiff are used instead + #changes="$changes_dir_base/jump/$jump_version/Changes.$version.txt" + : +# changes="$changes_dir_base/leap/$micro_version/Changes.$version.txt" +} diff --git a/publish_distro_conf/publish_leap-micro52_appliances.config b/publish_distro_conf/publish_leap-micro52_appliances.config new file mode 100644 index 00000000..9f695ea6 --- /dev/null +++ b/publish_distro_conf/publish_leap-micro52_appliances.config @@ -0,0 +1,58 @@ +# vim:syntax=sh + +micro_version=5.2 +release=0 +logfile_base=~/publish_logs/$micro_version-appliances/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap-micro/$micro_version/appliances" +flavors=(Default Default-RT Default-SelfInstall) +repos=() +extra_repos=() +isodir="" + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/openSUSE-Leap-Micro.x86_64-$micro_version.$release-$flavor-Build*.raw.xz` + version=${version##*Build} + version=${version%.*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +_get_iso() +{ + local snapshot="$1" + local suffix=xz +# echo "openSUSE-Leap-Micro-$micro_version-JeOS.x86_64-$micro_version.0-$flavor-$snapshot.$suffix" + echo "openSUSE-Leap-Micro.x86_64-$micro_version.$release-$flavor-$snapshot.$suffix" +} + +get_iso() +{ + iso=`_get_iso "Build$version"` +} + +get_iso_link() +{ + link="$stage/`_get_iso Current`" +} + +get_diff_url() +{ + url="" +} + +get_mark_published_url() +{ + url="" +} + +get_changes_filename() +{ + changes="" +} diff --git a/publish_distro_conf/publish_leap-micro53.config b/publish_distro_conf/publish_leap-micro53.config new file mode 100644 index 00000000..78fba2ba --- /dev/null +++ b/publish_distro_conf/publish_leap-micro53.config @@ -0,0 +1,50 @@ +# vim:syntax=sh + +micro_version=5.3 +qu="" # empty string for GA, QuarterlyUpdate repins have -N in version +logfile_base=~/publish_logs/$micro_version/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap-micro/$micro_version/product" +flavors=(DVD-x86_64 DVD-aarch64) + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/iso/openSUSE-Leap-Micro-$micro_version$qu-$flavor-Build[0123456789]*.[0123456789]*-Media.iso` + version=${version##*Build} + version=${version%-*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +get_iso() +{ + iso="openSUSE-Leap-Micro-$micro_version$qu-$flavor-Build$version-Media.iso" +} + +get_iso_link() +{ + link="$stage/iso/openSUSE-Leap-$micro_version$qu-$flavor-Current.iso" +} + +get_diff_url() +{ + url="$diff_url_base/$micro_version/diff/$version" +} + +get_mark_published_url() +{ + url="$diff_url_base/$micro_version/current" +} + +get_changes_filename() +{ + # ChangeLog files from obsgendiff are used instead + #changes="$changes_dir_base/jump/$jump_version/Changes.$version.txt" + : +# changes="$changes_dir_base/leap/$micro_version/Changes.$version.txt" +} diff --git a/publish_distro_conf/publish_leap-micro53_appliances.config b/publish_distro_conf/publish_leap-micro53_appliances.config new file mode 100644 index 00000000..e3eec87f --- /dev/null +++ b/publish_distro_conf/publish_leap-micro53_appliances.config @@ -0,0 +1,58 @@ +# vim:syntax=sh + +micro_version=5.3 +release=0 +logfile_base=~/publish_logs/$micro_version-appliances/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap-micro/$micro_version/appliances" +flavors=(Default Default-RT Default-SelfInstall) +repos=() +extra_repos=() +isodir="" + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/openSUSE-Leap-Micro.x86_64-$micro_version.$release-$flavor-Build*.raw.xz` + version=${version##*Build} + version=${version%.*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +_get_iso() +{ + local snapshot="$1" + local suffix=xz +# echo "openSUSE-Leap-Micro-$micro_version-JeOS.x86_64-$micro_version.0-$flavor-$snapshot.$suffix" + echo "openSUSE-Leap-Micro.x86_64-$micro_version.$release-$flavor-$snapshot.$suffix" +} + +get_iso() +{ + iso=`_get_iso "Build$version"` +} + +get_iso_link() +{ + link="$stage/`_get_iso Current`" +} + +get_diff_url() +{ + url="" +} + +get_mark_published_url() +{ + url="" +} + +get_changes_filename() +{ + changes="" +} diff --git a/publish_distro_conf/publish_leap150_jeos.config b/publish_distro_conf/publish_leap150_jeos.config new file mode 100644 index 00000000..68592049 --- /dev/null +++ b/publish_distro_conf/publish_leap150_jeos.config @@ -0,0 +1,61 @@ +# vim:syntax=sh + +leap_version=15.0 +logfile_base=~/publish_logs/$leap_version-jeos/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version/jeos" +flavors=(kvm-and-xen MS-HyperV OpenStack-Cloud VMware XEN) +repos=() +extra_repos=() +isodir="" + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/openSUSE-Leap-$leap_version-JeOS.x86_64-$leap_version.1-$flavor-Snapshot*.qcow2` + version=${version##*Snapshot} + version=${version%.*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +_get_iso() +{ + local snapshot="$1" + local suffix=qcow2 + if [ "$flavor" = 'MS-HyperV' ]; then + suffix=vhdx + elif [ "$flavor" = 'VMware' ]; then + suffix=vmdk + fi + echo "openSUSE-Leap-$leap_version-JeOS.x86_64-$leap_version.1-$flavor-$snapshot.$suffix" +} + +get_iso() +{ + iso=`_get_iso "Snapshot$version"` +} + +get_iso_link() +{ + link="$stage/`_get_iso Current`" +} + +get_diff_url() +{ + url="" +} + +get_mark_published_url() +{ + url="" +} + +get_changes_filename() +{ + changes="" +} diff --git a/publish_distro_conf/publish_leap150_live.config b/publish_distro_conf/publish_leap150_live.config new file mode 100644 index 00000000..6bb62a98 --- /dev/null +++ b/publish_distro_conf/publish_leap150_live.config @@ -0,0 +1,49 @@ +# vim:syntax=sh + +leap_version=15.0 +logfile_base=~/publish_logs/$leap_version-live/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version/live" +flavors=(GNOME-Live-x86_64 KDE-Live-x86_64 Rescue-CD-x86_64) +repos=() +extra_repos=() +isodir="" + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/openSUSE-Leap-$leap_version-$flavor-Snapshot*-Media.iso` + version=${version##*Snapshot} + version=${version%-*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +get_iso() +{ + iso="openSUSE-Leap-$leap_version-$flavor-Snapshot$version-Media.iso" +} + +get_iso_link() +{ + link="$stage/openSUSE-Leap-$leap_version-$flavor-Current.iso" +} + +get_diff_url() +{ + url="" +} + +get_mark_published_url() +{ + url="" +} + +get_changes_filename() +{ + changes="" +} diff --git a/publish_distro_conf/publish_leap151.config b/publish_distro_conf/publish_leap151.config new file mode 100644 index 00000000..0765fde2 --- /dev/null +++ b/publish_distro_conf/publish_leap151.config @@ -0,0 +1,46 @@ +# vim:syntax=sh + +leap_version=15.1 +logfile_base=~/publish_logs/$leap_version/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version" +flavors=(DVD-x86_64 NET-x86_64) + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/iso/openSUSE-Leap-$leap_version-$flavor-Build???.?-Media.iso` + version=${version##*Build} + version=${version%-*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +get_iso() +{ + iso="openSUSE-Leap-$leap_version-$flavor-Build$version-Media.iso" +} + +get_iso_link() +{ + link="$stage/iso/openSUSE-Leap-$leap_version-$flavor-Current.iso" +} + +get_diff_url() +{ + url="$diff_url_base/$leap_version/diff/$version" +} + +get_mark_published_url() +{ + url="$diff_url_base/$leap_version/current" +} + +get_changes_filename() +{ + changes="$changes_dir_base/leap/$leap_version/Changes.$version.txt" +} diff --git a/publish_distro_conf/publish_leap151_jeos.config b/publish_distro_conf/publish_leap151_jeos.config new file mode 100644 index 00000000..127528dd --- /dev/null +++ b/publish_distro_conf/publish_leap151_jeos.config @@ -0,0 +1,61 @@ +# vim:syntax=sh + +leap_version=15.1 +logfile_base=~/publish_logs/$leap_version-jeos/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version/jeos" +flavors=(kvm-and-xen MS-HyperV OpenStack-Cloud VMware XEN) +repos=() +extra_repos=() +isodir="" + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/openSUSE-Leap-$leap_version-JeOS.x86_64-$leap_version.?-$flavor-Snapshot*.qcow2` + version=${version##*Snapshot} + version=${version%.*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +_get_iso() +{ + local snapshot="$1" + local suffix=qcow2 + if [ "$flavor" = 'MS-HyperV' ]; then + suffix=vhdx.xz + elif [ "$flavor" = 'VMware' ]; then + suffix=vmdk.xz + fi + echo "openSUSE-Leap-$leap_version-JeOS.x86_64-$leap_version.0-$flavor-$snapshot.$suffix" +} + +get_iso() +{ + iso=`_get_iso "Snapshot$version"` +} + +get_iso_link() +{ + link="$stage/`_get_iso Current`" +} + +get_diff_url() +{ + url="" +} + +get_mark_published_url() +{ + url="" +} + +get_changes_filename() +{ + changes="" +} diff --git a/publish_distro_conf/publish_leap151_live.config b/publish_distro_conf/publish_leap151_live.config new file mode 100644 index 00000000..ec32f728 --- /dev/null +++ b/publish_distro_conf/publish_leap151_live.config @@ -0,0 +1,49 @@ +# vim:syntax=sh + +leap_version=15.1 +logfile_base=~/publish_logs/$leap_version-live/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version/live" +flavors=(GNOME-Live-x86_64 KDE-Live-x86_64 Rescue-CD-x86_64) +repos=() +extra_repos=() +isodir="" + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/openSUSE-Leap-$leap_version-$flavor-Snapshot*-Media.iso` + version=${version##*Snapshot} + version=${version%-*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +get_iso() +{ + iso="openSUSE-Leap-$leap_version-$flavor-Snapshot$version-Media.iso" +} + +get_iso_link() +{ + link="$stage/openSUSE-Leap-$leap_version-$flavor-Current.iso" +} + +get_diff_url() +{ + url="" +} + +get_mark_published_url() +{ + url="" +} + +get_changes_filename() +{ + changes="" +} diff --git a/publish_distro_conf/publish_leap152.config b/publish_distro_conf/publish_leap152.config new file mode 100644 index 00000000..c9a99c61 --- /dev/null +++ b/publish_distro_conf/publish_leap152.config @@ -0,0 +1,46 @@ +# vim:syntax=sh + +leap_version=15.2 +logfile_base=~/publish_logs/$leap_version/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version" +flavors=(DVD-x86_64 NET-x86_64) + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/iso/openSUSE-Leap-$leap_version-$flavor-Build???.?-Media.iso` + version=${version##*Build} + version=${version%-*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +get_iso() +{ + iso="openSUSE-Leap-$leap_version-$flavor-Build$version-Media.iso" +} + +get_iso_link() +{ + link="$stage/iso/openSUSE-Leap-$leap_version-$flavor-Current.iso" +} + +get_diff_url() +{ + url="$diff_url_base/$leap_version/diff/$version" +} + +get_mark_published_url() +{ + url="$diff_url_base/$leap_version/current" +} + +get_changes_filename() +{ + changes="$changes_dir_base/leap/$leap_version/Changes.$version.txt" +} diff --git a/publish_distro_conf/publish_leap152_jeos.config b/publish_distro_conf/publish_leap152_jeos.config new file mode 100644 index 00000000..ea30e3f7 --- /dev/null +++ b/publish_distro_conf/publish_leap152_jeos.config @@ -0,0 +1,61 @@ +# vim:syntax=sh + +leap_version=15.2 +logfile_base=~/publish_logs/$leap_version-jeos/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version/jeos" +flavors=(kvm-and-xen MS-HyperV OpenStack-Cloud VMware XEN) +repos=() +extra_repos=() +isodir="" + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/openSUSE-Leap-$leap_version-JeOS.x86_64-$leap_version.?-$flavor-Snapshot*.qcow2` + version=${version##*Snapshot} + version=${version%.*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +_get_iso() +{ + local snapshot="$1" + local suffix=qcow2 + if [ "$flavor" = 'MS-HyperV' ]; then + suffix=vhdx.xz + elif [ "$flavor" = 'VMware' ]; then + suffix=vmdk.xz + fi + echo "openSUSE-Leap-$leap_version-JeOS.x86_64-$leap_version.0-$flavor-$snapshot.$suffix" +} + +get_iso() +{ + iso=`_get_iso "Snapshot$version"` +} + +get_iso_link() +{ + link="$stage/`_get_iso Current`" +} + +get_diff_url() +{ + url="" +} + +get_mark_published_url() +{ + url="" +} + +get_changes_filename() +{ + changes="" +} diff --git a/publish_distro_conf/publish_leap152_live.config b/publish_distro_conf/publish_leap152_live.config new file mode 100644 index 00000000..782bd818 --- /dev/null +++ b/publish_distro_conf/publish_leap152_live.config @@ -0,0 +1,49 @@ +# vim:syntax=sh + +leap_version=15.2 +logfile_base=~/publish_logs/$leap_version-live/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version/live" +flavors=(GNOME-Live-x86_64 KDE-Live-x86_64 Rescue-CD-x86_64) +repos=() +extra_repos=() +isodir="" + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/openSUSE-Leap-$leap_version-$flavor-Snapshot*-Media.iso` + version=${version##*Snapshot} + version=${version%-*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +get_iso() +{ + iso="openSUSE-Leap-$leap_version-$flavor-Snapshot$version-Media.iso" +} + +get_iso_link() +{ + link="$stage/openSUSE-Leap-$leap_version-$flavor-Current.iso" +} + +get_diff_url() +{ + url="" +} + +get_mark_published_url() +{ + url="" +} + +get_changes_filename() +{ + changes="" +} diff --git a/publish_distro_conf/publish_leap153.config b/publish_distro_conf/publish_leap153.config new file mode 100644 index 00000000..11ece562 --- /dev/null +++ b/publish_distro_conf/publish_leap153.config @@ -0,0 +1,51 @@ +# vim:syntax=sh + +leap_version=15.3 +qu="-3" # empty string for GA, QuarterlyUpdate repins have -N in version +logfile_base=~/publish_logs/$leap_version/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version" +flavors=(DVD-x86_64 NET-x86_64 DVD-aarch64 NET-aarch64 DVD-ppc64le NET-ppc64le DVD-s390x NET-s390x) + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/iso/openSUSE-Leap-$leap_version$qu-$flavor-Build[0123456789]*.[0123456789]*-Media.iso` + version=${version##*Build} + version=${version%-*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +get_iso() +{ + iso="openSUSE-Leap-$leap_version$qu-$flavor-Build$version-Media.iso" +} + +get_iso_link() +{ + link="$stage/iso/openSUSE-Leap-$leap_version$qu-$flavor-Current.iso" +} + +get_diff_url() +{ + url="$diff_url_base/$leap_version/diff/$version" +} + +get_mark_published_url() +{ + url="$diff_url_base/$leap_version/current" +} + +get_changes_filename() +{ + # ChangeLog files from obsgendiff are used instead + #changes="$changes_dir_base/jump/$jump_version/Changes.$version.txt" + : +# changes="$changes_dir_base/leap/$leap_version/Changes.$version.txt" +} + diff --git a/publish_distro_conf/publish_leap153_appliances.config b/publish_distro_conf/publish_leap153_appliances.config new file mode 100644 index 00000000..3540e5ee --- /dev/null +++ b/publish_distro_conf/publish_leap153_appliances.config @@ -0,0 +1,62 @@ +# vim:syntax=sh + +leap_version=15.3 +logfile_base=~/publish_logs/$leap_version-appliances/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version/appliances" +flavors=(kvm-and-xen MS-HyperV OpenStack-Cloud VMware) +repos=() +extra_repos=() +isodir="" + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/openSUSE-Leap-$leap_version-JeOS.x86_64-$leap_version-$flavor-Build*.qcow2` + version=${version##*Build} + version=${version%.*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +_get_iso() +{ + local snapshot="$1" + local suffix=qcow2 + if [ "$flavor" = 'MS-HyperV' ]; then + suffix=vhdx.xz + elif [ "$flavor" = 'VMware' ]; then + suffix=vmdk.xz + fi +# echo "openSUSE-Leap-$leap_version-JeOS.x86_64-$leap_version.0-$flavor-$snapshot.$suffix" + echo "openSUSE-Leap-$leap_version-JeOS.x86_64-$leap_version-$flavor-$snapshot.$suffix" +} + +get_iso() +{ + iso=`_get_iso "Build$version"` +} + +get_iso_link() +{ + link="$stage/`_get_iso Current`" +} + +get_diff_url() +{ + url="" +} + +get_mark_published_url() +{ + url="" +} + +get_changes_filename() +{ + changes="" +} diff --git a/publish_distro_conf/publish_leap153_live.config b/publish_distro_conf/publish_leap153_live.config new file mode 100644 index 00000000..f3f12e09 --- /dev/null +++ b/publish_distro_conf/publish_leap153_live.config @@ -0,0 +1,49 @@ +# vim:syntax=sh + +leap_version=15.3 +logfile_base=~/publish_logs/$leap_version-live/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version/live" +flavors=(GNOME-Live-x86_64 KDE-Live-x86_64 Rescue-CD-x86_64) +repos=() +extra_repos=() +isodir="" + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/openSUSE-Leap-$leap_version-$flavor-Snapshot*-Media.iso` + version=${version##*Snapshot} + version=${version%-*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +get_iso() +{ + iso="openSUSE-Leap-$leap_version-$flavor-Snapshot$version-Media.iso" +} + +get_iso_link() +{ + link="$stage/openSUSE-Leap-$leap_version-$flavor-Current.iso" +} + +get_diff_url() +{ + url="" +} + +get_mark_published_url() +{ + url="" +} + +get_changes_filename() +{ + changes="" +} diff --git a/publish_distro_conf/publish_leap154.config b/publish_distro_conf/publish_leap154.config new file mode 100644 index 00000000..3e988fb4 --- /dev/null +++ b/publish_distro_conf/publish_leap154.config @@ -0,0 +1,51 @@ +# vim:syntax=sh + +leap_version=15.4 +qu="" # empty string for GA, QuarterlyUpdate repins have -N in version +logfile_base=~/publish_logs/$leap_version/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version" +flavors=(DVD-x86_64 NET-x86_64 DVD-aarch64 NET-aarch64 DVD-ppc64le NET-ppc64le DVD-s390x NET-s390x) + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/iso/openSUSE-Leap-$leap_version$qu-$flavor-Build[0123456789]*.[0123456789]*-Media.iso` + version=${version##*Build} + version=${version%-*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +get_iso() +{ + iso="openSUSE-Leap-$leap_version$qu-$flavor-Build$version-Media.iso" +} + +get_iso_link() +{ + link="$stage/iso/openSUSE-Leap-$leap_version$qu-$flavor-Current.iso" +} + +get_diff_url() +{ + url="$diff_url_base/$leap_version/diff/$version" +} + +get_mark_published_url() +{ + url="$diff_url_base/$leap_version/current" +} + +get_changes_filename() +{ + # ChangeLog files from obsgendiff are used instead + #changes="$changes_dir_base/jump/$jump_version/Changes.$version.txt" + : +# changes="$changes_dir_base/leap/$leap_version/Changes.$version.txt" +} + diff --git a/publish_distro_conf/publish_leap154_appliances.config b/publish_distro_conf/publish_leap154_appliances.config new file mode 100644 index 00000000..80b32f83 --- /dev/null +++ b/publish_distro_conf/publish_leap154_appliances.config @@ -0,0 +1,63 @@ +# vim:syntax=sh + +leap_version=15.4 +logfile_base=~/publish_logs/$leap_version-appliances/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version/appliances" +flavors=(kvm-and-xen MS-HyperV OpenStack-Cloud VMware) +#flavors=() +repos=() +extra_repos=() +isodir="" + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/openSUSE-Leap-$leap_version-JeOS.x86_64-$leap_version-$flavor-Build*.qcow2` + version=${version##*Build} + version=${version%.*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +_get_iso() +{ + local snapshot="$1" + local suffix=qcow2 + if [ "$flavor" = 'MS-HyperV' ]; then + suffix=vhdx.xz + elif [ "$flavor" = 'VMware' ]; then + suffix=vmdk.xz + fi +# echo "openSUSE-Leap-$leap_version-JeOS.x86_64-$leap_version.0-$flavor-$snapshot.$suffix" + echo "openSUSE-Leap-$leap_version-JeOS.x86_64-$leap_version-$flavor-$snapshot.$suffix" +} + +get_iso() +{ + iso=`_get_iso "Build$version"` +} + +get_iso_link() +{ + link="$stage/`_get_iso Current`" +} + +get_diff_url() +{ + url="" +} + +get_mark_published_url() +{ + url="" +} + +get_changes_filename() +{ + changes="" +} diff --git a/publish_distro_conf/publish_leap154_live.config b/publish_distro_conf/publish_leap154_live.config new file mode 100644 index 00000000..65da60ca --- /dev/null +++ b/publish_distro_conf/publish_leap154_live.config @@ -0,0 +1,49 @@ +# vim:syntax=sh + +leap_version=15.4 +logfile_base=~/publish_logs/$leap_version-live/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version/live" +flavors=(GNOME-Live-x86_64 KDE-Live-x86_64 Rescue-CD-x86_64) +repos=() +extra_repos=() +isodir="" + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/openSUSE-Leap-$leap_version-$flavor-Snapshot*-Media.iso` + version=${version##*Snapshot} + version=${version%-*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +get_iso() +{ + iso="openSUSE-Leap-$leap_version-$flavor-Snapshot$version-Media.iso" +} + +get_iso_link() +{ + link="$stage/openSUSE-Leap-$leap_version-$flavor-Current.iso" +} + +get_diff_url() +{ + url="" +} + +get_mark_published_url() +{ + url="" +} + +get_changes_filename() +{ + changes="" +} diff --git a/publish_distro_conf/publish_leap155.config b/publish_distro_conf/publish_leap155.config new file mode 100644 index 00000000..41db4c84 --- /dev/null +++ b/publish_distro_conf/publish_leap155.config @@ -0,0 +1,51 @@ +# vim:syntax=sh + +leap_version=15.5 +qu="" # empty string for GA, QuarterlyUpdate repins have -N in version +logfile_base=~/publish_logs/$leap_version/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version" +flavors=(DVD-x86_64 NET-x86_64 DVD-aarch64 NET-aarch64 DVD-ppc64le NET-ppc64le DVD-s390x NET-s390x) + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/iso/openSUSE-Leap-$leap_version$qu-$flavor-Build[0123456789]*.[0123456789]*-Media.iso` + version=${version##*Build} + version=${version%-*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +get_iso() +{ + iso="openSUSE-Leap-$leap_version$qu-$flavor-Build$version-Media.iso" +} + +get_iso_link() +{ + link="$stage/iso/openSUSE-Leap-$leap_version$qu-$flavor-Current.iso" +} + +get_diff_url() +{ + url="$diff_url_base/$leap_version/diff/$version" +} + +get_mark_published_url() +{ + url="$diff_url_base/$leap_version/current" +} + +get_changes_filename() +{ + # ChangeLog files from obsgendiff are used instead + #changes="$changes_dir_base/jump/$jump_version/Changes.$version.txt" + : +# changes="$changes_dir_base/leap/$leap_version/Changes.$version.txt" +} + diff --git a/publish_distro_conf/publish_leap155_appliances.config b/publish_distro_conf/publish_leap155_appliances.config new file mode 100644 index 00000000..22473d8c --- /dev/null +++ b/publish_distro_conf/publish_leap155_appliances.config @@ -0,0 +1,63 @@ +# vim:syntax=sh + +leap_version=15.5 +logfile_base=~/publish_logs/$leap_version-appliances/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version/appliances" +flavors=(kvm-and-xen MS-HyperV OpenStack-Cloud VMware) +#flavors=() +repos=() +extra_repos=() +isodir="" + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/openSUSE-Leap-$leap_version-JeOS.x86_64-$leap_version-$flavor-Build*.qcow2` + version=${version##*Build} + version=${version%.*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +_get_iso() +{ + local snapshot="$1" + local suffix=qcow2 + if [ "$flavor" = 'MS-HyperV' ]; then + suffix=vhdx.xz + elif [ "$flavor" = 'VMware' ]; then + suffix=vmdk.xz + fi +# echo "openSUSE-Leap-$leap_version-JeOS.x86_64-$leap_version.0-$flavor-$snapshot.$suffix" + echo "openSUSE-Leap-$leap_version-JeOS.x86_64-$leap_version-$flavor-$snapshot.$suffix" +} + +get_iso() +{ + iso=`_get_iso "Build$version"` +} + +get_iso_link() +{ + link="$stage/`_get_iso Current`" +} + +get_diff_url() +{ + url="" +} + +get_mark_published_url() +{ + url="" +} + +get_changes_filename() +{ + changes="" +} diff --git a/publish_distro_conf/publish_leap155_live.config b/publish_distro_conf/publish_leap155_live.config new file mode 100644 index 00000000..08b68e21 --- /dev/null +++ b/publish_distro_conf/publish_leap155_live.config @@ -0,0 +1,49 @@ +# vim:syntax=sh + +leap_version=15.5 +logfile_base=~/publish_logs/$leap_version-live/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/distribution/leap/$leap_version/live" +flavors=(GNOME-Live-x86_64 KDE-Live-x86_64 Rescue-CD-x86_64) +repos=() +extra_repos=() +isodir="" + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/openSUSE-Leap-$leap_version-$flavor-Snapshot*-Media.iso` + version=${version##*Snapshot} + version=${version%-*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +get_iso() +{ + iso="openSUSE-Leap-$leap_version-$flavor-Snapshot$version-Media.iso" +} + +get_iso_link() +{ + link="$stage/openSUSE-Leap-$leap_version-$flavor-Current.iso" +} + +get_diff_url() +{ + url="" +} + +get_mark_published_url() +{ + url="" +} + +get_changes_filename() +{ + changes="" +} diff --git a/publish_distro_conf/publish_tumbleweed.config b/publish_distro_conf/publish_tumbleweed.config new file mode 100644 index 00000000..e19b93f7 --- /dev/null +++ b/publish_distro_conf/publish_tumbleweed.config @@ -0,0 +1,47 @@ +# vim:syntax=sh + +logfile_base=~/publish_logs/tumbleweed/$(date -d "$date" '+%Y/%m/%d/%H%M') +synclog="${logfile_base}.log" +deletelog="${logfile_base}-deletes.log" +path="/tumbleweed" +flavors=(DVD-x86_64 NET-x86_64 GNOME-Live-x86_64 KDE-Live-x86_64 Rescue-CD-x86_64 \ + DVD-i586 NET-i586 GNOME-Live-i686 KDE-Live-i686 Rescue-CD-i686) + +get_version() { + # get expected version from first flavor + if [ -z "$version" ]; then + version=`echo $stage/iso/openSUSE-Tumbleweed-$flavor-Snapshot????????-Media.iso` + version=${version##*Snapshot} + version=${version%-*} + if [ -z "$version" ]; then + echo "no version found, exit." | tee -a $synclog + exit 1 + fi + fi +} + +get_iso() +{ + iso="openSUSE-Tumbleweed-$flavor-Snapshot$version-Media.iso" +} + +get_iso_link() +{ + link="$stage/iso/openSUSE-Tumbleweed-$flavor-Current.iso" +} + +get_diff_url() +{ + url="$diff_url_base/tumbleweed/diff/$version" +} + +get_mark_published_url() +{ + url="$diff_url_base/tumbleweed/current" +} + +get_changes_filename() +{ + local year=`date +%Y` + changes="$changes_dir_base/tumbleweed/$year/Changes.$version.txt" +} From f952b4f4c7126556b8e49d0ad183e08aa7b4d75a Mon Sep 17 00:00:00 2001 From: Lubos Kocman Date: Fri, 5 Aug 2022 10:46:41 +0200 Subject: [PATCH 5/8] Correct publish_distro_conf path in CONTENTS.md --- CONTENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTENTS.md b/CONTENTS.md index 03fa8aa0..c70c4e34 100644 --- a/CONTENTS.md +++ b/CONTENTS.md @@ -19,7 +19,7 @@ Apart from these tools, the repository includes: * [GoCD](https://www.gocd.org) configuration files in [gocd](gocd). GoCD is an open source CI/CD server that is used to deploy the bots on OBS. * Several [systemd](systemd) units: the Metrics instance makes use of them. -* publish_distro tool and related configuration in publish_distro +* publish_distro tool and related configuration in publish_distro_conf to rsync content from OBS to ftp-stage/ftp-prod on pontifex host ## Tools From 3846ec49c6433ce3350a0393422e582100da1014 Mon Sep 17 00:00:00 2001 From: Lubos Kocman Date: Fri, 5 Aug 2022 10:56:36 +0200 Subject: [PATCH 6/8] Add basic README for publish_distro --- publish_distro_conf/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 publish_distro_conf/README.md diff --git a/publish_distro_conf/README.md b/publish_distro_conf/README.md new file mode 100644 index 00000000..1e9f13b5 --- /dev/null +++ b/publish_distro_conf/README.md @@ -0,0 +1,20 @@ +# publish_distro configuration files + +## Tools + +configuration files in this repository are used by `../publish_distro` +to publish content from ftp-stage to ftp-prod on the pontifex host + +Individual releases have its own section in +`pontifex.infra.opensuse.org:~mirror/bin/publish_factory_leap` which +is triggered by a cronjob on a regular basis. + + +## Getting access to the host + +Users need to have [openSUSE Heroes](https://en.opensuse.org/openSUSE:Heroes) VPN access to be able to access pontifex.infra.opensuse.org. + +## Deployment of publish_distro and related configuration + +publish_distro should be deployed as part of `openSUSE-release-tools` rpm by openSUSE heroes. +Configuration files will be currently checked out from git under the `mirror` user. \ No newline at end of file From 5337f5cea1be9d1341c58d41f1d2d45e645dc9a9 Mon Sep 17 00:00:00 2001 From: Lubos Kocman Date: Wed, 10 Aug 2022 14:39:01 +0200 Subject: [PATCH 7/8] Add publish-distro subpackage to spec --- dist/package/openSUSE-release-tools.spec | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dist/package/openSUSE-release-tools.spec b/dist/package/openSUSE-release-tools.spec index a9f5b1c8..3d023055 100644 --- a/dist/package/openSUSE-release-tools.spec +++ b/dist/package/openSUSE-release-tools.spec @@ -187,6 +187,19 @@ BuildArch: noarch %description origin-manager Tools for managing the origin of package sources and keeping them in sync. +%package publish-distro +Summary: Tool for publishing ftp-stage to ftp-prod +Group: Development/Tools/Other +Requires: rsync +# Currently in openSUSE infra repo +Requires: python-mb +Requires(pre): shadow +BuildArch: noarch + +%description publish-distro +publish_distro tool and related configuration in publish_distro to rsync +content from OBS to ftp-stage/ftp-prod on pontifex host. + %package repo-checker Summary: Repository checker service Group: Development/Tools/Other @@ -475,6 +488,9 @@ exit 0 %{_bindir}/osrt-origin-manager %{_datadir}/%{source_dir}/origin-manager.py +%files publish-distro +%{_bindir}/publish-distro + %files repo-checker %{_bindir}/osrt-project-installcheck %{_bindir}/osrt-staging-installcheck From b731ff342cda27733d8e3d5fbddb6a5bb18a3e81 Mon Sep 17 00:00:00 2001 From: Lubos Kocman Date: Wed, 10 Aug 2022 14:40:02 +0200 Subject: [PATCH 8/8] MirrorCache does not require mb makehashes * Confirmed with Andrii Nikitin --- publish_distro | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/publish_distro b/publish_distro index 29a8b9b8..5eafe029 100755 --- a/publish_distro +++ b/publish_distro @@ -272,10 +272,12 @@ if [ -n "$url" ]; then $dryrun curl -X POST -F "version=$version" "$url" fi -echo creating hashes +#echo creating hashes #metalink-hasher update -t /srv/metalink-hashes/srv/ftp/pub/opensuse/tumbleweed \ # -b /srv/ftp/pub/opensuse/tumbleweed \ # /srv/ftp/pub/opensuse/tumbleweed -$dryrun /usr/bin/mb makehashes -b /srv/ftp/pub/opensuse \ - -t /srv/metalink-hashes/srv/ftp/pub/opensuse \ - $dest + +# mb makehaskes is not needed by mirrorcache (replaced mirrorbrain) +#$dryrun /usr/bin/mb makehashes -b /srv/ftp/pub/opensuse \ +# -t /srv/metalink-hashes/srv/ftp/pub/opensuse \ +# $dest