Compare commits
2 Commits
master
...
c5401d6abd
Author | SHA1 | Date | |
---|---|---|---|
c5401d6abd | |||
020f01bce9 |
31
build.sh
31
build.sh
@@ -43,28 +43,13 @@ echo "Compiling tailwindcss and building zola project..."
|
|||||||
rm -rf public static/css
|
rm -rf public static/css
|
||||||
./tailwindcss -i css/index.css -o ./static/css/index.css --minify
|
./tailwindcss -i css/index.css -o ./static/css/index.css --minify
|
||||||
|
|
||||||
# Auto-detect deployment environment based on git branch
|
|
||||||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
||||||
echo "Detected git branch: $CURRENT_BRANCH"
|
|
||||||
|
|
||||||
if [ "$CURRENT_BRANCH" = "master" ]; then
|
echo "Building for staging deployment..."
|
||||||
# Production deployment (www.mycelium.threefold.io)
|
sed 's|base_url = "BASEURL"|base_url = "https://www2.mycelium.threefold.io/"|' config.templ.toml > config.toml
|
||||||
echo "Building for PRODUCTION environment..."
|
|
||||||
BASE_URL="https://www.mycelium.threefold.io/"
|
|
||||||
DEPLOY_PATH="root@threefold.info:/root/hero/www/info/$PREFIX/"
|
|
||||||
elif [ "$CURRENT_BRANCH" = "development" ]; then
|
|
||||||
# Staging deployment (www2.mycelium.threefold.io)
|
|
||||||
echo "Building for STAGING environment..."
|
|
||||||
BASE_URL="https://www2.mycelium.threefold.io/"
|
|
||||||
DEPLOY_PATH="root@threefold.info:/root/hero/www/info/$PREFIX/"
|
|
||||||
else
|
|
||||||
# Fallback for other branches (local development mode)
|
|
||||||
echo "Building for LOCAL/OTHER branch environment..."
|
|
||||||
BASE_URL="/mycelium/"
|
|
||||||
DEPLOY_PATH="${HOME}/hero/var/www/$PREFIX/"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Using base_url: $BASE_URL"
|
|
||||||
sed "s|base_url = \"BASEURL\"|base_url = \"$BASE_URL\"|" config.templ.toml > config.toml
|
|
||||||
zola --root $ABS_DIR_OF_SCRIPT build
|
zola --root $ABS_DIR_OF_SCRIPT build
|
||||||
echo "Build completed successfully! Static files generated in public/ directory."
|
rsync -avz --delete public/ "root@threefold.info:/root/hero/www/info/$PREFIX/"
|
||||||
|
|
||||||
|
# echo "Building with prefix: /$PREFIX/"
|
||||||
|
# sed 's|base_url = "BASEURL"|base_url = "/mycelium/"|' config.templ.toml > config.toml
|
||||||
|
# zola --root $ABS_DIR_OF_SCRIPT build
|
||||||
|
# rsync -rav --delete public/ "${HOME}/hero/var/www/$PREFIX/"
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
# The URL the site will be built for
|
# The URL the site will be built for
|
||||||
base_url = "https://www.mycelium.threefold.io/"
|
base_url = "https://www2.mycelium.threefold.io/"
|
||||||
|
|
||||||
title = "Mycelium"
|
title = "Mycelium"
|
||||||
description = "Our global digital backbone"
|
description = "Our global digital backbone"
|
||||||
|
Reference in New Issue
Block a user