Created
March 28, 2018 09:08
-
-
Save dirkmueller/b13e6af3dcb9f0b9a98ed8d06fd90508 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
fpn=/usr/share/osc-plugin-factory/factory-package-news/factory-package-news.py | |
cd ~/src/Cloud/provo/media-announcer | |
save_new_media() { | |
local dir=$1 | |
local media=$2 | |
currentmedia=$(cut -d- -f7 < $media/media.1/build) | |
if [ -z $currentmedia ]; then | |
echo "buildid is not set!" | |
exit 1 | |
fi | |
if [ ! -r $dir/$currentmedia ]; then | |
echo "new $dir media: $currentmedia!" | |
$fpn save --dir $PWD/$dir --snapshot=$currentmedia $media | |
# workaround race | |
[ -s $PWD/$dir/$currentmedia ] || rm -f $PWD/$dir/$currentmedia | |
fi | |
} | |
save_new_media dc8s /mounts/dist/ibs/Devel:/Cloud:/8:/Staging/images/repo/SUSE-OPENSTACK-CLOUD-8-POOL-x86_64-Media1/ | |
save_new_media dc8 /mounts/dist/ibs/Devel:/Cloud:/8/images/repo/SUSE-OPENSTACK-CLOUD-8-POOL-x86_64-Media1/ | |
save_new_media sc8 /mounts/dist/ibs/SUSE:/SLE-12-SP3:/Update:/Products:/Cloud8/images/repo/SUSE-OPENSTACK-CLOUD-8-POOL-x86_64-Media1/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment