You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
1.9 KiB
96 lines
1.9 KiB
# i need to preserve --release in args, not to pass cargo make -p release |
|
# due to cargo failing to parse "" argument |
|
env_scripts = [''' |
|
#!@duckscript |
|
args = array ${1} ${2} ${3} ${4} ${5} ${6} ${7} |
|
set_env PROFILE_OVERRIDE debug |
|
|
|
for arg in ${args} |
|
e = eq ${arg} "--release" |
|
if ${e} |
|
set_env PROFILE_OVERRIDE release |
|
end |
|
end |
|
|
|
profile = get_env PROFILE_OVERRIDE |
|
echo PROFILE_OVERRIDE=${profile} |
|
'''] |
|
|
|
[config] |
|
default_to_workspace = false |
|
|
|
[env] |
|
TARGET = "x86_64-unknown-linux-musl" |
|
CARGO = "cargo" |
|
|
|
[tasks.build_static_libs] |
|
script = "./scripts/build_musl_libs.sh" |
|
|
|
[tasks.build_frontend] |
|
script = ''' |
|
cd ./bin/u_panel/src/gui/fe |
|
ng build |
|
''' |
|
|
|
[tasks.clean] |
|
command = "${CARGO}" |
|
args = ["clean"] |
|
|
|
[tasks.cargo_build] |
|
dependencies = ["build_static_libs", "build_frontend"] |
|
command = "${CARGO}" |
|
args = ["build", "--target", "${TARGET}", "${@}"] |
|
|
|
[tasks.cargo_update] |
|
command = "${CARGO}" |
|
args = ["update"] |
|
|
|
[tasks.release_tasks] |
|
condition = { env = { PROFILE_OVERRIDE = "release"} } |
|
script = ''' |
|
BINS=$(ls ./target/${TARGET}/${PROFILE_OVERRIDE}/u_* -1 | grep -v ".d") |
|
echo "Stripping..." |
|
strip $BINS |
|
echo "Packing..." |
|
upx -9 $BINS |
|
''' |
|
|
|
[tasks.build] |
|
dependencies = ["cargo_build", "release_tasks"] |
|
clear = true |
|
|
|
[tasks.run] |
|
disabled = true |
|
|
|
[tasks.run_front] |
|
script = ''' |
|
cd ./bin/u_panel/src/gui/fe |
|
ng serve |
|
''' |
|
|
|
[tasks.unit-tests] |
|
command = "${CARGO}" |
|
args = ["test", "--target", "${TARGET}", "--lib", "--", "${@}"] |
|
|
|
[tasks.ut] |
|
alias = "unit-tests" |
|
|
|
[tasks.integration-tests] |
|
dependencies = ["cargo_update"] |
|
script = ''' |
|
[[ ! -d "./target/${TARGET}/${PROFILE_OVERRIDE}" ]] && echo 'No target folder. Build project first' && exit 1 |
|
cd ./integration-tests |
|
bash integration_tests.sh ${@} |
|
''' |
|
|
|
[tasks.it] |
|
alias = "integration-tests" |
|
|
|
[tasks.test] |
|
dependencies = ["unit", "integration-tests"] |
|
|
|
[tasks.gen_schema] |
|
script = './scripts/gen_schema.sh' |
|
|
|
[tasks.deploy] |
|
script = './scripts/deploy.sh'
|
|
|