Restore AppFactory scripts to stable versions
This commit is contained in:
@@ -1,24 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
CONFIG_FILE="$HOME/.appfactory/env"
|
||||
|
||||
if [ ! -f "$CONFIG_FILE" ]; then
|
||||
echo "Missing config file: $CONFIG_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CONFIG_FILE="/opt/appfactory/config/appfactory.env"
|
||||
source "$CONFIG_FILE"
|
||||
|
||||
APP_ID="${1:-}"
|
||||
APP_NAME="${2:-$APP_ID}"
|
||||
|
||||
if [ -z "$APP_ID" ]; then
|
||||
echo "Usage:"
|
||||
echo " ./new-python-app.sh <app-id> [app-name]"
|
||||
echo ""
|
||||
echo "Example:"
|
||||
echo " ./new-python-app.sh gmail-app \"Gmail App\""
|
||||
echo "Usage: ./new-python-app.sh <app-id> [app-name]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -48,7 +38,7 @@ id: $APP_ID
|
||||
name: $APP_NAME
|
||||
language: python
|
||||
version: 1.0.0
|
||||
base_path: /$APP_ID
|
||||
base_path: /apps/$APP_ID
|
||||
port: 8000
|
||||
status: development
|
||||
EOF_APP
|
||||
@@ -57,19 +47,6 @@ cat > README.md <<EOF_README
|
||||
# $APP_NAME
|
||||
|
||||
Generated by AppFactory.
|
||||
|
||||
## Local build
|
||||
|
||||
\`\`\`bash
|
||||
docker build -t $APP_ID .
|
||||
docker run --rm -p 8001:8000 $APP_ID
|
||||
\`\`\`
|
||||
|
||||
Open:
|
||||
|
||||
\`\`\`text
|
||||
http://SERVER_IP:8001/docs
|
||||
\`\`\`
|
||||
EOF_README
|
||||
|
||||
echo "Creating Gitea repository..."
|
||||
@@ -122,6 +99,8 @@ git add .
|
||||
git commit -m "Initial $APP_NAME"
|
||||
git push -u origin main
|
||||
|
||||
chown -R "$APP_USER:$APP_GROUP" "$TARGET_DIR" || true
|
||||
|
||||
echo ""
|
||||
echo "DONE"
|
||||
echo "Repository:"
|
||||
|
||||
Reference in New Issue
Block a user