Upload read-only archive.
By uploading read-only archive, we prevent potential (implicit) re-upload. A re-upload will always be possible if we remove the archive and rerun the workflow. But it will be clearly explicit in this case.
This commit is contained in:
parent
f7706428a2
commit
dc814c626d
|
@ -226,7 +226,7 @@ def upload(file_to_upload, host, dest_path):
|
||||||
|
|
||||||
command = [
|
command = [
|
||||||
"scp",
|
"scp",
|
||||||
"-r",
|
"-rp",
|
||||||
"-P",
|
"-P",
|
||||||
port,
|
port,
|
||||||
"-i",
|
"-i",
|
||||||
|
@ -241,6 +241,10 @@ def upload(file_to_upload, host, dest_path):
|
||||||
|
|
||||||
|
|
||||||
def upload_archive(archive, project, make_release):
|
def upload_archive(archive, project, make_release):
|
||||||
|
if not archive.exists():
|
||||||
|
print_message("No archive {} to upload!", archive)
|
||||||
|
return
|
||||||
|
|
||||||
if project.startswith("kiwix-") or project in ['libkiwix']:
|
if project.startswith("kiwix-") or project in ['libkiwix']:
|
||||||
host = "ci@master.download.kiwix.org:30022"
|
host = "ci@master.download.kiwix.org:30022"
|
||||||
dest_path = "/data/download/"
|
dest_path = "/data/download/"
|
||||||
|
@ -253,6 +257,10 @@ def upload_archive(archive, project, make_release):
|
||||||
else:
|
else:
|
||||||
dest_path = dest_path + "nightly/" + DATE
|
dest_path = dest_path + "nightly/" + DATE
|
||||||
|
|
||||||
|
# Make the archive read only. This way, scp will preserve rights.
|
||||||
|
# If somehow we try to upload twice the same archive, scp will fails.
|
||||||
|
archive.chmod(0o444)
|
||||||
|
|
||||||
upload(archive, host, dest_path)
|
upload(archive, host, dest_path)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue