mirror of
https://github.com/unraid/api.git
synced 2026-05-03 21:50:20 -05:00
fix(api): update deploy-dev script to dist instead of src
This commit is contained in:
committed by
Pujit Mehrotra
parent
bf3b00fbaf
commit
2327b00d30
@@ -7,3 +7,15 @@ default:
|
|||||||
setup:
|
setup:
|
||||||
npm install
|
npm install
|
||||||
npm run container:build
|
npm run container:build
|
||||||
|
|
||||||
|
# builds js files that can run on an unraid server
|
||||||
|
@build:
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
# deploys to an unraid server
|
||||||
|
@deploy:
|
||||||
|
./scripts/deploy-dev.sh
|
||||||
|
|
||||||
|
# build & deploy
|
||||||
|
bd: build deploy
|
||||||
|
|
||||||
|
|||||||
@@ -23,12 +23,16 @@ fi
|
|||||||
echo "$server_name" > "$state_file"
|
echo "$server_name" > "$state_file"
|
||||||
|
|
||||||
# Source directory path
|
# Source directory path
|
||||||
source_directory="./src"
|
source_directory="./dist"
|
||||||
|
|
||||||
if [ ! -d "$source_directory" ]; then
|
if [ ! -d "$source_directory" ]; then
|
||||||
echo "The src directory does not exist."
|
echo "The dist directory does not exist. Attempting build..."
|
||||||
|
npm run build
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Build failed!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Replace the value inside the rsync command with the user's input
|
# Replace the value inside the rsync command with the user's input
|
||||||
rsync_command="rsync -avz -e ssh $source_directory root@${server_name}:/usr/local/unraid-api"
|
rsync_command="rsync -avz -e ssh $source_directory root@${server_name}:/usr/local/unraid-api"
|
||||||
@@ -57,3 +61,4 @@ fi
|
|||||||
|
|
||||||
# Exit with the rsync command's exit code
|
# Exit with the rsync command's exit code
|
||||||
exit $exit_code
|
exit $exit_code
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user