2024-05-31 17:58:39 +00:00
|
|
|
#!/bin/bash
|
2024-04-24 17:29:19 +00:00
|
|
|
|
2024-06-13 19:14:33 +00:00
|
|
|
GENERATED_ARTIFACTS="generated_artifacts_${BUILD_TYPE}_${TARGET_ARCH}"
|
2024-06-13 21:35:13 +00:00
|
|
|
SRC_ARTIFACTS="src_artifacts_${BUILD_TYPE}_${TARGET_ARCH}"
|
2024-06-13 19:14:33 +00:00
|
|
|
|
2024-04-24 17:29:19 +00:00
|
|
|
mv_if_exist() {
|
2024-06-13 19:14:33 +00:00
|
|
|
if [ -f "${GENERATED_ARTIFACTS}/$1" ] || [ -d "${GENERATED_ARTIFACTS}/$1" ]; then
|
2024-04-24 17:29:19 +00:00
|
|
|
echo Restoring $1 to $2
|
|
|
|
mkdir -p $2
|
2024-06-13 19:14:33 +00:00
|
|
|
mv $GENERATED_ARTIFACTS/$1 $2
|
2024-04-24 17:29:19 +00:00
|
|
|
else
|
|
|
|
echo Skipping $1 - It is not present on disk
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2024-06-12 19:16:49 +00:00
|
|
|
untar_if_exist() {
|
2024-06-13 21:35:13 +00:00
|
|
|
if [ -f "${SRC_ARTIFACTS}/$1" ] || [ -d "${SRC_ARTIFACTS}/$1" ]; then
|
2024-06-13 19:14:33 +00:00
|
|
|
echo Restoring $1 to current directory
|
2024-06-13 21:35:13 +00:00
|
|
|
tar -xf ${SRC_ARTIFACTS}/$1
|
2024-06-12 19:16:49 +00:00
|
|
|
else
|
|
|
|
echo Skipping $1 - It is not present on disk
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2024-06-13 19:14:33 +00:00
|
|
|
echo Restoring artifacts from $GENERATED_ARTIFACTS
|
|
|
|
|
2024-06-12 19:16:49 +00:00
|
|
|
# Restore generated artifacts
|
2024-04-24 17:29:19 +00:00
|
|
|
mv_if_exist dist.zip src/out/Default
|
|
|
|
mv_if_exist node_headers.tar.gz src/out/Default/gen
|
|
|
|
mv_if_exist symbols.zip src/out/Default
|
|
|
|
mv_if_exist mksnapshot.zip src/out/Default
|
|
|
|
mv_if_exist chromedriver.zip src/out/Default
|
|
|
|
mv_if_exist ffmpeg.zip src/out/ffmpeg
|
|
|
|
mv_if_exist hunspell_dictionaries.zip src/out/Default
|
2024-06-12 19:16:49 +00:00
|
|
|
mv_if_exist cross-arch-snapshots src
|
|
|
|
|
2024-06-13 21:35:13 +00:00
|
|
|
echo Restoring artifacts from $SRC_ARTIFACTS
|
|
|
|
|
|
|
|
# Restore src artifacts
|
|
|
|
untar_if_exist src_artifacts.tar
|