|
| 1 | +services: |
| 2 | + dev-server: |
| 3 | + name: RedwoodJS Development Server |
| 4 | + description: Runs the RedwoodJS development server for both web and api sides |
| 5 | + commands: |
| 6 | + start: | |
| 7 | + # Ensure corepack is enabled in service environment |
| 8 | + corepack enable |
| 9 | + cd /workspaces/rw-test-app |
| 10 | + NODE_ENV=development corepack yarn rw dev |
| 11 | +
|
| 12 | +tasks: |
| 13 | + setup-environment: |
| 14 | + name: Setup RedwoodJS Environment |
| 15 | + description: Setup RedwoodJS development environment (runs automatically after devcontainer starts) |
| 16 | + triggeredBy: |
| 17 | + - postDevcontainerStart |
| 18 | + command: | |
| 19 | + export RWFW_PATH="/workspaces/RedwoodGraphQL" |
| 20 | + export REDWOOD_DISABLE_TELEMETRY=1 |
| 21 | + echo "Setting up RedwoodJS development environment..." |
| 22 | + mkdir -p /workspaces/rw-test-app |
| 23 | + cd /workspaces/RedwoodGraphQL |
| 24 | + echo "Cleaning up existing symlinks and cache..." |
| 25 | + rm -rf node_modules/@redwoodjs |
| 26 | + rm -rf node_modules/.cache |
| 27 | + rm -f yarn.lock |
| 28 | + corepack yarn cache clean --all 2>/dev/null || true |
| 29 | + echo "Installing framework dependencies..." |
| 30 | + corepack yarn install |
| 31 | + echo "Building test project..." |
| 32 | + corepack yarn run build:test-project ../rw-test-app --typescript --link --verbose |
| 33 | + cd /workspaces/rw-test-app |
| 34 | + sed -i "s/\(open *= *\).*/\1false/" redwood.toml |
| 35 | + echo -e "\n\n\033[94m ======================================================\n\033[33m ⌛ RedwoodJS development environment is ready!\n Test app \"rw-test-app\" has been generated & linked with framework code.\n\n If you make changes to the framework:\n 1. \033[33mEnsure env vars are set \033[92mexport RWFW_PATH=\"/workspaces/RedwoodGraphQL\"\033[33m\n 2. \033[33mRun \033[92mcorepack yarn rwfw project:sync\033[33m to sync changes\n 3. \033[33mOr use the \033[92mSync Framework Changes\033[33m task from Ona dashboard\n\033[94m ======================================================\n\n" |
| 36 | + # Open ports for RedwoodJS development servers |
| 37 | + echo "Opening ports for development servers..." |
| 38 | + gitpod environment port open 8910 --name "RedwoodJS Web Server" --protocol https |
| 39 | + gitpod environment port open 8911 --name "RedwoodJS API Server" --protocol https |
| 40 | + echo "✅ Ports 8910 (Web) and 8911 (API) are now open with HTTPS" |
| 41 | + # Signal completion |
| 42 | + touch /tmp/redwood-setup-complete |
| 43 | + echo "✅ Setup task completed successfully" |
| 44 | +
|
| 45 | + start-dev-after-setup: |
| 46 | + name: Start Development Server After Setup |
| 47 | + description: Automatically start the development server after setup completes |
| 48 | + triggeredBy: |
| 49 | + - postDevcontainerStart |
| 50 | + command: | |
| 51 | + # Wait for setup to complete |
| 52 | + echo "Waiting for setup to complete..." |
| 53 | + while [ ! -f /tmp/redwood-setup-complete ]; do |
| 54 | + sleep 2 |
| 55 | + done |
| 56 | + echo "Setup completed, starting development server..." |
| 57 | + # Ensure ports are open before starting service |
| 58 | + gitpod environment port open 8910 --name "RedwoodJS Web Server" --protocol https 2>/dev/null || true |
| 59 | + gitpod environment port open 8911 --name "RedwoodJS API Server" --protocol https 2>/dev/null || true |
| 60 | + gitpod automations service start dev-server |
| 61 | + echo "✅ Development server started" |
| 62 | +
|
| 63 | + sync-framework-changes: |
| 64 | + name: Sync Framework Changes |
| 65 | + description: Manually sync framework changes to test project |
| 66 | + triggeredBy: |
| 67 | + - manual |
| 68 | + command: | |
| 69 | + export RWFW_PATH="/workspaces/RedwoodGraphQL" |
| 70 | + cd /workspaces/rw-test-app |
| 71 | + corepack yarn rwfw project:sync |
| 72 | + echo "Framework changes synced to test project" |
| 73 | +
|
| 74 | + start-dev-server: |
| 75 | + name: Start Development Server |
| 76 | + description: Start the RedwoodJS development server |
| 77 | + triggeredBy: |
| 78 | + - manual |
| 79 | + command: | |
| 80 | + gitpod automations service start dev-server |
| 81 | +
|
| 82 | + stop-dev-server: |
| 83 | + name: Stop Development Server |
| 84 | + description: Stop the RedwoodJS development server |
| 85 | + triggeredBy: |
| 86 | + - manual |
| 87 | + command: | |
| 88 | + gitpod automations service stop dev-server |
| 89 | +
|
| 90 | + restart-dev-server: |
| 91 | + name: Restart Development Server |
| 92 | + description: Restart the RedwoodJS development server |
| 93 | + triggeredBy: |
| 94 | + - manual |
| 95 | + command: | |
| 96 | + gitpod automations service stop dev-server |
| 97 | + sleep 2 |
| 98 | + gitpod automations service start dev-server |
| 99 | +
|
| 100 | + open-ports: |
| 101 | + name: Open Development Ports |
| 102 | + description: Open ports 8910 (Web) and 8911 (API) for external access with HTTPS |
| 103 | + triggeredBy: |
| 104 | + - manual |
| 105 | + command: | |
| 106 | + echo "Opening RedwoodJS development ports with HTTPS..." |
| 107 | + gitpod environment port open 8910 --name "RedwoodJS Web Server" --protocol https |
| 108 | + gitpod environment port open 8911 --name "RedwoodJS API Server" --protocol https |
| 109 | + echo "✅ Ports opened successfully with HTTPS protocol" |
| 110 | + gitpod environment port list |
| 111 | +
|
| 112 | + close-ports: |
| 113 | + name: Close Development Ports |
| 114 | + description: Close ports 8910 (Web) and 8911 (API) |
| 115 | + triggeredBy: |
| 116 | + - manual |
| 117 | + command: | |
| 118 | + echo "Closing RedwoodJS development ports..." |
| 119 | + gitpod environment port close 8910 |
| 120 | + gitpod environment port close 8911 |
| 121 | + echo "✅ Ports closed successfully" |
| 122 | +
|
| 123 | + list-ports: |
| 124 | + name: List Port Status |
| 125 | + description: Show current status of all ports |
| 126 | + triggeredBy: |
| 127 | + - manual |
| 128 | + command: | |
| 129 | + echo "Current port status:" |
| 130 | + gitpod environment port list |
0 commit comments