|
|
|
[config]
|
|
|
|
default_to_workspace = false
|
|
|
|
|
|
|
|
[env]
|
|
|
|
TARGET = "x86_64-unknown-linux-musl"
|
|
|
|
CARGO = "cargo"
|
|
|
|
PREFIX = "${CARGO_MAKE_WORKING_DIRECTORY}/static"
|
|
|
|
PQ_LIB_STATIC_X86_64_UNKNOWN_LINUX_MUSL = "true"
|
|
|
|
PG_CONFIG_X86_64_UNKNOWN_LINUX_GNU = "${PREFIX}/bin/pg_config"
|
|
|
|
OPENSSL_STATIC = "true"
|
|
|
|
OPENSSL_DIR = "${PREFIX}"
|
|
|
|
|
|
|
|
[tasks.build_static_libs]
|
|
|
|
script = "./scripts/build_musl_libs.sh"
|
|
|
|
|
|
|
|
[tasks.build_frontend]
|
|
|
|
script = '''
|
|
|
|
cd ./bin/u_panel/src/server/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.release_tasks]
|
|
|
|
script = '''
|
|
|
|
if [[ "${@}" =~ "release" ]]; then
|
|
|
|
echo "Stripping binaries..."
|
|
|
|
strip $(ls ./target/${TARGET}/release/u_* -1 | grep -v ".d")
|
|
|
|
echo "Creating symlink to release dir..."
|
|
|
|
ln -s ./target/${TARGET}/release ./release || true
|
|
|
|
fi
|
|
|
|
'''
|
|
|
|
|
|
|
|
[tasks.build]
|
|
|
|
dependencies = ["cargo_build", "release_tasks"]
|
|
|
|
command = "true"
|
|
|
|
args = []
|
|
|
|
|
|
|
|
[tasks.run]
|
|
|
|
script = '''
|
|
|
|
echo "wtf are you running? run binaries dud!"
|
|
|
|
exit 1
|
|
|
|
'''
|
|
|
|
|
|
|
|
[tasks.unit]
|
|
|
|
command = "${CARGO}"
|
|
|
|
args = ["test", "--target", "${TARGET}", "--lib", "--", "${@}"]
|
|
|
|
|
|
|
|
[tasks.integration]
|
|
|
|
script = '''
|
|
|
|
cd ./integration
|
|
|
|
bash integration_tests.sh
|
|
|
|
'''
|
|
|
|
|
|
|
|
[tasks.gen_schema]
|
|
|
|
script = '''
|
|
|
|
docker run --rm \
|
|
|
|
--env-file=$PWD/.env \
|
|
|
|
--env-file=$PWD/.env.private \
|
|
|
|
-v $PWD:/unki \
|
|
|
|
-w /unki \
|
|
|
|
unki/u_db \
|
|
|
|
/unki/images/integration-tests/u_db_entrypoint.sh || true
|
|
|
|
'''
|
|
|
|
|
|
|
|
[tasks.test]
|
|
|
|
dependencies = ["unit", "integration"]
|
|
|
|
|
|
|
|
[tasks.deploy]
|
|
|
|
script = './scripts/deploy.sh'
|