Add documentation management and reorganize scaffold docs
- Add wild-setup-docs command to copy documentation to cloud projects - Move node setup guide from scaffold to main docs/guides/ - Add app workflow guide to main docs/guides/ - Update cluster installation scripts to use standard env initialization
This commit is contained in:
73
bin/wild-setup-docs
Executable file
73
bin/wild-setup-docs
Executable file
@@ -0,0 +1,73 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# Parse arguments
|
||||
UPDATE=false
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--update)
|
||||
UPDATE=true
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
echo "Usage: $0 [--update]"
|
||||
echo ""
|
||||
echo "Copy Wild-Cloud documentation to the current cloud directory."
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " --update Update existing docs (overwrite)"
|
||||
echo " -h, --help Show this help message"
|
||||
echo ""
|
||||
exit 0
|
||||
;;
|
||||
-*)
|
||||
echo "Unknown option $1"
|
||||
echo "Usage: $0 [--update]"
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
echo "Unexpected argument: $1"
|
||||
echo "Usage: $0"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
echo "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
DOCS_DEST="${WC_HOME}/docs"
|
||||
|
||||
# Check if docs already exist
|
||||
if [ -d "${DOCS_DEST}" ] && [ "${UPDATE}" = false ]; then
|
||||
echo "Documentation already exists at ${DOCS_DEST}"
|
||||
read -p "Do you want to update documentation files? (y/N): " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
UPDATE=true
|
||||
else
|
||||
echo "Skipping documentation update."
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Copy docs directory from root to WC_HOME
|
||||
if [ -d "${WC_ROOT}/docs" ]; then
|
||||
if [ "${UPDATE}" = true ] && [ -d "${DOCS_DEST}" ]; then
|
||||
rm -rf "${DOCS_DEST}"
|
||||
fi
|
||||
cp -r "${WC_ROOT}/docs" "${DOCS_DEST}"
|
||||
print_success "Documentation copied to ${DOCS_DEST}"
|
||||
else
|
||||
print_error "Source docs directory not found: ${WC_ROOT}/docs"
|
||||
exit 1
|
||||
fi
|
46
docs/guides/app-workflow.md
Normal file
46
docs/guides/app-workflow.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Wild-Cloud App Workflow
|
||||
|
||||
The Wild-cloud app workflow consists of three steps:
|
||||
|
||||
1. **Fetch** - Download raw app templates to cache
|
||||
2. **Config** - Apply your local configuration to templates
|
||||
3. **Deploy** - Deploy configured app to Kubernetes
|
||||
|
||||
## Commands
|
||||
|
||||
To list all available apps:
|
||||
|
||||
```bash
|
||||
wild-apps-list
|
||||
```
|
||||
|
||||
To fetch an app template to cache:
|
||||
|
||||
```bash
|
||||
wild-app-fetch <app>
|
||||
```
|
||||
|
||||
To apply your configuration to a cached app (automatically fetches if not cached):
|
||||
|
||||
```bash
|
||||
wild-app-config <app>
|
||||
```
|
||||
|
||||
To deploy a configured app to Kubernetes:
|
||||
|
||||
```bash
|
||||
wild-app-deploy <app>
|
||||
```
|
||||
|
||||
## Quick Setup
|
||||
|
||||
For a complete app setup and deployment:
|
||||
|
||||
```bash
|
||||
wild-app-config <app> # Fetches if needed, then configures
|
||||
wild-app-deploy <app> # Deploys to Kubernetes
|
||||
```
|
||||
|
||||
## App Directory Structure
|
||||
|
||||
Your wild-cloud apps are stored in the `apps/` directory. You can change them however you like. You should keep them all in git and make commits anytime you change something. Some `wild` commands will overwrite files in your app directory (like when you are updating apps, or updating your configuration) so you'll want to review any changes made to your files after using them using `git`.
|
@@ -2,13 +2,15 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ -z "${WC_HOME}" ]; then
|
||||
echo "Please source the wildcloud environment first. (e.g., \`source ./env.sh\`)"
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
source "${WC_ROOT}/bin/wild-common.sh"
|
||||
|
||||
CLUSTER_SETUP_DIR="${WC_HOME}/setup/cluster"
|
||||
CERT_MANAGER_DIR="${CLUSTER_SETUP_DIR}/cert-manager"
|
||||
|
||||
|
@@ -2,13 +2,15 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ -z "${WC_HOME}" ]; then
|
||||
echo "Please source the wildcloud environment first. (e.g., \`source ./env.sh\`)"
|
||||
# Initialize Wild-Cloud environment
|
||||
if [ -z "${WC_ROOT}" ]; then
|
||||
print "WC_ROOT is not set."
|
||||
exit 1
|
||||
else
|
||||
source "${WC_ROOT}/scripts/common.sh"
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
source "${WC_ROOT}/bin/wild-common.sh"
|
||||
|
||||
CLUSTER_SETUP_DIR="${WC_HOME}/setup/cluster"
|
||||
COREDNS_DIR="${CLUSTER_SETUP_DIR}/coredns"
|
||||
|
||||
|
@@ -11,8 +11,6 @@ else
|
||||
init_wild_env
|
||||
fi
|
||||
|
||||
source "${WC_ROOT}/bin/wild-common.sh"
|
||||
|
||||
CLUSTER_SETUP_DIR="${WC_HOME}/setup/cluster"
|
||||
LONGHORN_DIR="${CLUSTER_SETUP_DIR}/longhorn"
|
||||
|
||||
|
Reference in New Issue
Block a user