|
| 1 | +# Codespaces Configuration |
| 2 | + |
| 3 | +This directory contains the GitHub Codespaces dev container configuration. |
| 4 | + |
| 5 | +## Port Visibility Issue |
| 6 | + |
| 7 | +If port 8080 shows as **private** after creating a Codespace, you need to manually change it to **public**: |
| 8 | + |
| 9 | +### Manual Steps: |
| 10 | +1. Open the **PORTS** panel at the bottom of VS Code (next to TERMINAL) |
| 11 | +2. Find port **8080** in the list |
| 12 | +3. **Right-click** on port 8080 |
| 13 | +4. Select **Port Visibility** → **Public** |
| 14 | +5. Refresh your browser and access Jenkins |
| 15 | + |
| 16 | +### Why is this needed? |
| 17 | + |
| 18 | +The `devcontainer.json` includes `"visibility": "public"` for port 8080, but GitHub Codespaces may not always apply this setting automatically, especially: |
| 19 | +- On the first Codespace creation |
| 20 | +- If there's an organization policy |
| 21 | +- If the port is forwarded before the container is fully started |
| 22 | + |
| 23 | +The setup script attempts to set the port visibility automatically using the GitHub CLI, but if that fails, manual intervention is required. |
| 24 | + |
| 25 | +## Files |
| 26 | + |
| 27 | +- **devcontainer.json** - Dev container specification |
| 28 | +- **setup.sh** - Initialization script (installs yq, configures URLs, creates welcome message) |
| 29 | +- **welcome.txt** - Generated welcome message (not in git, created at runtime) |
| 30 | +- **README.md** - This file |
| 31 | + |
| 32 | +## Accessing Jenkins |
| 33 | + |
| 34 | +After starting a tutorial with `docker compose --profile <name> up -d`: |
| 35 | +- Jenkins URL: `https://<codespace>-8080.<domain>` (shown in PORTS panel) |
| 36 | +- Default credentials: admin/admin |
| 37 | + |
| 38 | +## Troubleshooting |
| 39 | + |
| 40 | +**Port 8080 refuses connection:** |
| 41 | +- Ensure port visibility is set to **public** (see steps above) |
| 42 | +- Verify Jenkins is running: `docker compose ps` |
| 43 | +- Check logs: `docker compose logs jenkins_controller` |
| 44 | + |
| 45 | +**Welcome message not showing:** |
| 46 | +- Run: `source ~/.bashrc` in your terminal |
| 47 | +- Or open a new terminal window |
| 48 | + |
| 49 | +**yq not found:** |
| 50 | +- Run: `bash .devcontainer/setup.sh` manually |
0 commit comments