Merge "Save images according to their branch"
This commit is contained in:
commit
d8f75408c4
|
@ -30,7 +30,22 @@ file {"/var/www/html/builds":
|
||||||
ensure => "directory",
|
ensure => "directory",
|
||||||
owner => "apache",
|
owner => "apache",
|
||||||
}
|
}
|
||||||
|
file { '/var/www/html/builds-master':
|
||||||
|
ensure => 'link',
|
||||||
|
target => '/var/www/html/builds',
|
||||||
|
}
|
||||||
|
file {"/var/www/html/builds-ocata":
|
||||||
|
ensure => "directory",
|
||||||
|
owner => "apache",
|
||||||
|
}
|
||||||
|
file {"/var/www/html/builds-newton":
|
||||||
|
ensure => "directory",
|
||||||
|
owner => "apache",
|
||||||
|
}
|
||||||
|
file {"/var/www/html/builds-mitaka":
|
||||||
|
ensure => "directory",
|
||||||
|
owner => "apache",
|
||||||
|
}
|
||||||
|
|
||||||
cron {"refresh-server":
|
cron {"refresh-server":
|
||||||
command => "timeout 20m puppet apply /opt/stack/tripleo-ci/scripts/mirror-server/mirror-server.pp",
|
command => "timeout 20m puppet apply /opt/stack/tripleo-ci/scripts/mirror-server/mirror-server.pp",
|
||||||
|
|
|
@ -8,7 +8,7 @@ import shutil
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
basedir="/var/www/html/builds"
|
basedir="/var/www/html/"
|
||||||
|
|
||||||
print("Content-Type: text/html\n")
|
print("Content-Type: text/html\n")
|
||||||
def saveform(form, storagedir):
|
def saveform(form, storagedir):
|
||||||
|
@ -49,7 +49,13 @@ def run():
|
||||||
print("repohash missing")
|
print("repohash missing")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
storagedir = os.path.abspath(os.path.join(basedir,repohash))
|
try:
|
||||||
|
branch_dir = form["folder"].value
|
||||||
|
except KeyError:
|
||||||
|
print("upload folder missing")
|
||||||
|
return 1
|
||||||
|
|
||||||
|
storagedir = os.path.abspath(os.path.join(basedir, branch_dir, repohash))
|
||||||
if basedir not in storagedir:
|
if basedir not in storagedir:
|
||||||
print("incorrect hash")
|
print("incorrect hash")
|
||||||
return 1
|
return 1
|
||||||
|
|
|
@ -140,12 +140,13 @@ if [[ $CACHEUPLOAD == 1 && $NUM_CHANGES -le 1 && $OTHER_PROJECTS == "no" ]] ; th
|
||||||
md5sum overcloud-full.tar > overcloud-full.tar.md5
|
md5sum overcloud-full.tar > overcloud-full.tar.md5
|
||||||
md5sum ipa_images.tar > ipa_images.tar.md5
|
md5sum ipa_images.tar > ipa_images.tar.md5
|
||||||
|
|
||||||
curl http://$MIRRORSERVER/cgi-bin/upload.cgi -F "repohash=$TRUNKREPOUSED" -F "upload=@ipa_images.tar;filename=ipa_images.tar"
|
UPLOAD_FOLDER=builds${STABLE_RELEASE:+-$STABLE_RELEASE}
|
||||||
curl http://$MIRRORSERVER/cgi-bin/upload.cgi -F "repohash=$TRUNKREPOUSED" -F "upload=@overcloud-full.tar;filename=overcloud-full.tar"
|
curl http://$MIRRORSERVER/cgi-bin/upload.cgi -F "repohash=$TRUNKREPOUSED" -F "folder=$UPLOAD_FOLDER" -F "upload=@ipa_images.tar;filename=ipa_images.tar"
|
||||||
|
curl http://$MIRRORSERVER/cgi-bin/upload.cgi -F "repohash=$TRUNKREPOUSED" -F "folder=$UPLOAD_FOLDER" -F "upload=@overcloud-full.tar;filename=overcloud-full.tar"
|
||||||
# TODO(pabelanger): Remove qcow2 format, since centos-7 cannot mount nbd with the default kernel.
|
# TODO(pabelanger): Remove qcow2 format, since centos-7 cannot mount nbd with the default kernel.
|
||||||
curl http://$MIRRORSERVER/cgi-bin/upload.cgi -F "repohash=$TRUNKREPOUSED" -F "upload=@ipa_images.tar.md5;filename=ipa_images.tar.md5"
|
curl http://$MIRRORSERVER/cgi-bin/upload.cgi -F "repohash=$TRUNKREPOUSED" -F "folder=$UPLOAD_FOLDER" -F "upload=@ipa_images.tar.md5;filename=ipa_images.tar.md5"
|
||||||
curl http://$MIRRORSERVER/cgi-bin/upload.cgi -F "repohash=$TRUNKREPOUSED" -F "upload=@overcloud-full.tar.md5;filename=overcloud-full.tar.md5"
|
curl http://$MIRRORSERVER/cgi-bin/upload.cgi -F "repohash=$TRUNKREPOUSED" -F "folder=$UPLOAD_FOLDER" -F "upload=@overcloud-full.tar.md5;filename=overcloud-full.tar.md5"
|
||||||
curl http://$MIRRORSERVER/cgi-bin/upload.cgi -F "repohash=$TRUNKREPOUSED" -F "$JOB_NAME=SUCCESS"
|
curl http://$MIRRORSERVER/cgi-bin/upload.cgi -F "repohash=$TRUNKREPOUSED" -F "folder=$UPLOAD_FOLDER" -F "$JOB_NAME=SUCCESS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo 'Run completed.'
|
echo 'Run completed.'
|
||||||
|
|
Loading…
Reference in New Issue