76 lines
1.5 KiB
Bash
76 lines
1.5 KiB
Bash
#!/bin/sh
|
|
|
|
# Default configurations:
|
|
DEPLOY_HELPER_ENABLE_NIKOLA=true
|
|
DEPLOY_HELPER_ENABLE_NODE=false
|
|
|
|
if test -f .deployment-helper
|
|
then
|
|
# shellcheck source=/dev/null
|
|
. .deployment-helper
|
|
fi
|
|
|
|
|
|
|
|
if $DEPLOY_HELPER_ENABLE_NODE
|
|
then
|
|
if ! command -v node >/dev/null 2>&1
|
|
then
|
|
echo "node not found" 1>&2
|
|
exit 1
|
|
fi
|
|
if ! command -v npm >/dev/null 2>&1
|
|
then
|
|
echo "npm not found" 1>&2
|
|
exit 1
|
|
fi
|
|
if ! test -d node
|
|
then
|
|
echo "Node directory not found" 1>&2
|
|
exit 1
|
|
fi
|
|
|
|
cd node || { echo 'Directory "node" not found'; exit 1;}
|
|
if ! npm install
|
|
then
|
|
echo "Error installing node-dependencies" 1>&2
|
|
exit 1
|
|
fi
|
|
if test -f nuxt.config.ts
|
|
then
|
|
# Build for nuxi based Sites
|
|
if ! npx nuxi build
|
|
then
|
|
echo "Error nuxi build" 1>&2
|
|
exit 1
|
|
fi
|
|
if ! npx nuxi generate
|
|
then
|
|
echo "Error nuxi generate" 1>&2
|
|
exit 1
|
|
fi
|
|
else
|
|
echo "No supportet node website type found" 1>&2
|
|
exit 1
|
|
fi
|
|
cd ..
|
|
fi
|
|
|
|
if $DEPLOY_HELPER_ENABLE_NIKOLA
|
|
then
|
|
if ! test -d website
|
|
then
|
|
echo "Website directory not found" 1>&2
|
|
exit 1
|
|
fi
|
|
|
|
if ! command -v nikola >/dev/null 2>&1
|
|
then
|
|
echo "nikola command not found" 1>&2
|
|
exit 1
|
|
fi
|
|
cd website || { echo 'Directory "website" not found'; exit 1;}
|
|
nikola build
|
|
cd ..
|
|
fi
|
|
exit "$?"
|