ci: compress deploy artifact to speed up ssh publish
This commit is contained in:
@@ -97,6 +97,19 @@ if [ ! -f "$SOURCE_BIN" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$SOURCE_BIN" == *.gz ]]; then
|
||||
if ! command -v gzip >/dev/null 2>&1; then
|
||||
echo "gzip not found on server" >&2
|
||||
exit 1
|
||||
fi
|
||||
decompressed_bin="${SOURCE_BIN%.gz}"
|
||||
log "decompressing binary: ${SOURCE_BIN} -> ${decompressed_bin}"
|
||||
gzip -dc "$SOURCE_BIN" > "$decompressed_bin"
|
||||
chmod 755 "$decompressed_bin"
|
||||
rm -f "$SOURCE_BIN"
|
||||
SOURCE_BIN="$decompressed_bin"
|
||||
fi
|
||||
|
||||
log "deploy start, release: ${RELEASE_ID}"
|
||||
mkdir -p "$DIST_DIR" "$APP_DIR/backups"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user