5 Commits

Author SHA1 Message Date
191ee3f98b ok 2025-09-02 13:50:50 +02:00
f2fa57e7bb Implement branch-aware deployment: auto-detect environment to prevent merge conflicts
- Auto-detects git branch (master/development/other)
- Sets correct base_url for each environment:
  * master -> https://www.mycelium.threefold.io/ (production)
  * development -> https://www2.mycelium.threefold.io/ (staging)
  * other -> /mycelium/ (local development)
- Eliminates merge conflicts between staging and production
- Enables seamless branch merging workflow
2025-09-02 13:24:15 +02:00
767e4a2eea add config.toml 2025-09-02 13:08:41 +02:00
2055eb2956 del 2025-09-02 13:06:27 +02:00
bca4094ab3 replace docs 2025-09-01 17:24:31 +02:00
9 changed files with 30 additions and 16 deletions

1
.gitignore vendored
View File

@@ -33,3 +33,4 @@ install*
public
static/css
tailwindcss
config.toml

View File

@@ -43,14 +43,28 @@ echo "Compiling tailwindcss and building zola project..."
rm -rf public static/css
./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"
# echo "Building without prefix..."
# sed 's|base_url = "BASEURL"|base_url = "https://www.mycelium.threefold.io/"|' config.templ.toml > config.toml
# zola --root $ABS_DIR_OF_SCRIPT build
# rsync -avz --delete public/ "root@threefold.info:/root/hero/www/info/$PREFIX/"
if [ "$CURRENT_BRANCH" = "master" ]; then
# Production deployment (www.mycelium.threefold.io)
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 "Building with prefix: /$PREFIX/"
sed 's|base_url = "BASEURL"|base_url = "/mycelium/"|' config.templ.toml > config.toml
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
rsync -rav --delete public/ "${HOME}/hero/var/www/$PREFIX/"
rsync -avz --delete public/ "root@threefold.info:/root/hero/www/info/$PREFIX/"
echo "Build completed successfully! Static files generated in public/ directory."

View File

@@ -1,6 +1,5 @@
# The URL the site will be built for
base_url = "https://www.mycelium.threefold.io/"
# Change this to your own URL! Please note this variable **must** be uncommented .
title = "Mycelium"
description = "Our global digital backbone"

View File

@@ -105,7 +105,7 @@ True digital sovereignty for open-source builders. The ThreeFold Grid provides l
|||
<button>[The Manual](https://manual.grid.tf/labs/documentation/system_administrators/mycelium_toc/)</button>
<button>[The Manual](https://docs.ourworld.tf/mycelium_cloud/docs/)</button>
|||

View File

@@ -102,7 +102,7 @@ extra:
button_text="Download Now",
button_link="/download",
button_text2="Read More",
button_link2="https://manual.grid.tf/labs/documentation/system_administrators/mycelium_toc/"
button_link2="https://docs.ourworld.tf/mycelium_cloud/docs/"
) }}

View File

@@ -15,7 +15,7 @@ extra:
title="Download Mycelium",
description="Get Mycelium for Android, Windows, macOS, and iOS to securely connect, store, and interact with the decentralized network—seamlessly and efficiently.",
description3="Not sure how it works?",
button_link="https://manual.grid.tf/labs/documentation/system_administrators/mycelium_toc/",
button_link="https://docs.ourworld.tf/mycelium_cloud/docs/",
button_text="Read the manual."
) }}
@@ -142,5 +142,5 @@ extra:
button_text="Download Now",
button_link="/download",
button_text2="Read More",
button_link2="https://manual.grid.tf/labs/documentation/system_administrators/mycelium_toc/"
button_link2="https://docs.ourworld.tf/mycelium_cloud/docs/"
) }}

View File

@@ -14,7 +14,7 @@ extra:
<br>
###### [Manual](https://manual.grid.tf/labs/documentation/system_administrators/mycelium_toc/)
###### [Manual](https://docs.ourworld.tf/mycelium_cloud/docs/)
###### [Dashboard](https://dashboard.grid.tf/)

View File

@@ -9,6 +9,6 @@ extra:
---
- [About]("/about")
- [Docs]("https://manual.grid.tf/labs/documentation/system_administrators/mycelium_toc/")
- [Docs]("https://docs.ourworld.tf/mycelium_cloud/docs/")

View File

@@ -314,7 +314,7 @@ extra:
button_text="Download Now",
button_link="/download",
button_text2="Read More",
button_link2="https://manual.grid.tf/labs/documentation/system_administrators/mycelium_toc/"
button_link2="https://docs.ourworld.tf/mycelium_cloud/docs/"
) }}