Skip to content

Commit 4ff9131

Browse files
dbkrrichvdh
authored andcommitted
Redeploy script: don't bail if bundle exists (element-hq#4977)
Just don't bother replacing that bundle. Continue redeploying the rest as other assets (eg translation files) may have changed.
1 parent a94710a commit 4ff9131

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

‎scripts/deploy.py‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import subprocess
1414
import sys
1515
import tarfile
16+
import shutil
1617

1718
try:
1819
# python3
@@ -48,11 +49,12 @@ def move_bundles(source, dest):
4849
for f in os.listdir(source):
4950
dst = os.path.join(dest, f)
5051
if os.path.exists(dst):
51-
raise DeployException(
52-
"Not deploying. The bundle includes '%s' which we have previously deployed."
52+
print (
53+
"Skipping bundle. The bundle includes '%s' which we have previously deployed."
5354
% f
5455
)
55-
renames[os.path.join(source, f)] = dst
56+
else:
57+
renames[os.path.join(source, f)] = dst
5658

5759
for (src, dst) in renames.iteritems():
5860
print ("Move %s -> %s" % (src, dst))
@@ -107,9 +109,9 @@ def deploy(self, tarball, extract_path):
107109
extracted_bundles = os.path.join(extracted_dir, 'bundles')
108110
move_bundles(source=extracted_bundles, dest=self.bundles_path)
109111

110-
# replace the (hopefully now empty) extracted_bundles dir with a
111-
# symlink to the common dir.
112-
os.rmdir(extracted_bundles)
112+
# replace the extracted_bundles dir (which may not be empty if some
113+
# bundles were skipped) with a symlink to the common dir.
114+
shutil.rmtree(extracted_bundles)
113115
create_relative_symlink(
114116
target=self.bundles_path,
115117
linkname=extracted_bundles,

0 commit comments

Comments
 (0)