feat: transfer wowmine to neuro
This commit is contained in:
@@ -12,14 +12,14 @@ import tarfile
|
||||
import tempfile
|
||||
|
||||
root = Path(sys.argv[1]).resolve()
|
||||
host = sys.argv[2] if len(sys.argv) > 2 else 'hectic-lab'
|
||||
host = sys.argv[2] if len(sys.argv) > 2 else 'neuro'
|
||||
if host.startswith('-'):
|
||||
raise ValueError('Invalid SSH host')
|
||||
release = hashlib.sha256((root / 'pack/pack.toml').read_bytes()).hexdigest()
|
||||
with tempfile.TemporaryDirectory(prefix='prism-publish-') as temporary:
|
||||
archive = Path(temporary) / 'publish.tar.gz'
|
||||
with tarfile.open(archive, 'w:gz') as tar:
|
||||
for name in ['pack', 'WorldOfSosal-Prism.zip', 'SHA256SUMS', 'index.html']:
|
||||
for name in ['pack', 'wowmine-Prism.zip', 'SHA256SUMS', 'index.html']:
|
||||
tar.add(root / name, arcname=name)
|
||||
for path in root.glob('*.mrpack'):
|
||||
tar.add(path, arcname=path.name)
|
||||
@@ -28,7 +28,7 @@ with tempfile.TemporaryDirectory(prefix='prism-publish-') as temporary:
|
||||
subprocess.run(['ssh', '-o', 'BatchMode=yes', host, f'cat > {remote}'], stdin=upload, check=True)
|
||||
script = '''set -eu
|
||||
umask 022
|
||||
base=/var/www/store/minecraft/world-of-sosal
|
||||
base=/var/www/wowmine/public/minecraft/wowmine
|
||||
release=RELEASE
|
||||
archive=/tmp/prism-publish-$release.tar.gz
|
||||
mkdir -p "$base/releases"
|
||||
@@ -50,7 +50,7 @@ done
|
||||
for source in "$stage"/*.mrpack; do
|
||||
mv "$source" "$base/$(basename "$source")"
|
||||
done
|
||||
for name in WorldOfSosal-Prism.zip SHA256SUMS index.html; do
|
||||
for name in wowmine-Prism.zip SHA256SUMS index.html; do
|
||||
mv "$stage/$name" "$base/$name"
|
||||
done
|
||||
ln -s "releases/$release" "$stage/current"
|
||||
@@ -58,4 +58,4 @@ mv -Tf "$stage/current" "$base/current"
|
||||
echo "Published $release"
|
||||
'''.replace('RELEASE', release)
|
||||
subprocess.run(['ssh', '-o', 'BatchMode=yes', host, 'sh', '-s'], input=script, text=True, check=True)
|
||||
print(f'Published client files on {host}:/var/www/store/minecraft/world-of-sosal')
|
||||
print(f'Published client files on {host}:/var/www/wowmine/public/minecraft/wowmine')
|
||||
|
||||
Reference in New Issue
Block a user