Finished build script

This commit is contained in:
WolverinDEV 2019-07-05 21:58:48 +02:00
parent 33f4da4fca
commit 0209b0253f
2 changed files with 26 additions and 23 deletions

View File

@ -64,6 +64,31 @@ function compile_native() {
end_task "${project_name}_native" "Native extensions compiled"
}
function package_client() {
begin_task "${project_name}_package" "Packaging client"
npm run build-linux-64
check_err_exit ${project_name} "Failed to package client!"
end_task "${project_name}_package" "Client package created"
}
function deploy_client() {
begin_task "${project_name}_package" "Deploying client"
[[ -z ${teaclient_deploy_secret} ]] && {
echo "Missing deploy secret. Dont deploy client!"
return 0
}
[[ -z ${teaclient_deploy_channel} ]] && {
echo "Missing deploy channel. Dont deploy client!"
return 0
}
npm run package-linux-64 ${teaclient_deploy_channel}
check_err_exit ${project_name} "Failed to deploying client!"
end_task "${project_name}_package" "Client successfully deployed!"
}
install_npm
compile_scripts
compile_native
package_client
deploy_client

View File

@ -1,22 +0,0 @@
#!/usr/bin/env bash
cd "../$(dirname $0)"
if [[ "${teaclient_deploy_secret}" == "" ]]; then
echo "Missing deploy secret!"
exit 1
fi
if [[ $# -lt 1 ]]; then
echo "Missing build channel!"
exit 1
fi
npm run build-linux-64
if [[ $? -ne 0 ]]; then
echo "Failed to build project"
fi
npm run package-linux-64 $1
if [[ $? -ne 0 ]]; then
echo "Failed to package project"
fi