Skip to content

Commit 354f013

Browse files
gountharclaude
andcommitted
fix: improve Codespaces welcome message visibility and suppress GitPod warnings
Changes: - Change postCreateCommand to onCreateCommand for better output visibility - Add postStartCommand to display welcome message on every terminal - Create persistent welcome.txt file with tutorial instructions - Add welcome.txt to .gitignore (generated at runtime) - Set default empty values for GITPOD_WORKSPACE_URL to suppress warnings The welcome message now displays: - Available tutorial profiles - Quick start commands - Jenkins URL (auto-detected for Codespaces) - Default credentials Fixes the issue where setup script output wasn't visible in the terminal. 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent fe2f15f commit 354f013

File tree

4 files changed

+56
-39
lines changed

4 files changed

+56
-39
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
}
1313
},
1414

15-
"postCreateCommand": "bash .devcontainer/setup.sh",
15+
"onCreateCommand": "bash .devcontainer/setup.sh",
16+
"postStartCommand": "cat .devcontainer/welcome.txt 2>/dev/null || echo 'Run: .devcontainer/setup.sh for tutorial instructions'",
1617

1718
"forwardPorts": [8080, 3000, 5000],
1819

.devcontainer/setup.sh

Lines changed: 47 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -32,39 +32,54 @@ else
3232
echo "⚠️ Warning: codespacesURL.sh not found, skipping URL configuration"
3333
fi
3434

35-
# Display available Docker Compose profiles
36-
echo ""
37-
echo "================================"
38-
echo "✅ Setup Complete!"
39-
echo "================================"
40-
echo ""
41-
echo "Available tutorial profiles:"
42-
echo " - default : Basic Jenkins with SSH agent"
43-
echo " - maven : Jenkins + Maven build environment"
44-
echo " - python : Jenkins + Python development"
45-
echo " - node : Jenkins + Node.js/npm"
46-
echo " - multi : Multibranch pipeline example"
47-
echo " - android : Android development"
48-
echo " - golang : Go development"
49-
echo " - cpp : C++ development"
50-
echo " - dotnet : .NET development"
51-
echo " - wizard : Jenkins setup wizard (learning)"
52-
echo ""
53-
echo "To start a tutorial environment:"
54-
echo " docker compose --profile <profile-name> up -d"
55-
echo ""
56-
echo "Example:"
57-
echo " docker compose --profile maven up -d"
58-
echo ""
59-
echo "To build images locally instead of using pre-built ones:"
60-
echo " docker compose -f build-docker-compose.yaml --profile <profile-name> up -d"
61-
echo ""
62-
echo "Jenkins will be accessible at:"
35+
# Create welcome message for future terminal sessions
36+
WELCOME_FILE=".devcontainer/welcome.txt"
37+
cat > "$WELCOME_FILE" << 'WELCOME_EOF'
38+
39+
================================
40+
🚀 Jenkins Quickstart Tutorials
41+
================================
42+
43+
Available tutorial profiles:
44+
• default : Basic Jenkins with SSH agent
45+
• maven : Jenkins + Maven build environment
46+
• python : Jenkins + Python development
47+
• node : Jenkins + Node.js/npm
48+
• multi : Multibranch pipeline example
49+
• android : Android development
50+
• golang : Go development
51+
• cpp : C++ development
52+
• dotnet : .NET development
53+
• wizard : Jenkins setup wizard (learning)
54+
55+
Quick Start:
56+
docker compose --profile <profile-name> up -d
57+
58+
Examples:
59+
docker compose --profile maven up -d
60+
docker compose --profile node up -d
61+
62+
To build locally:
63+
docker compose -f build-docker-compose.yaml --profile <profile-name> up -d
64+
65+
WELCOME_EOF
66+
67+
# Add Jenkins URL based on environment
6368
if [ -n "$CODESPACE_NAME" ] && [ -n "$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN" ]; then
64-
echo " https://${CODESPACE_NAME}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}"
69+
echo "Jenkins will be accessible at:" >> "$WELCOME_FILE"
70+
echo " https://${CODESPACE_NAME}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}" >> "$WELCOME_FILE"
6571
else
66-
echo " http://localhost:8080"
72+
echo "Jenkins will be accessible at:" >> "$WELCOME_FILE"
73+
echo " http://localhost:8080" >> "$WELCOME_FILE"
6774
fi
68-
echo ""
69-
echo "Default credentials: admin/admin"
75+
76+
echo "" >> "$WELCOME_FILE"
77+
echo "Default credentials: admin/admin" >> "$WELCOME_FILE"
78+
echo "================================" >> "$WELCOME_FILE"
79+
echo "" >> "$WELCOME_FILE"
80+
81+
# Display the welcome message
82+
cat "$WELCOME_FILE"
83+
84+
echo "✅ Setup Complete! Welcome message saved to $WELCOME_FILE"
7085
echo ""

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ secrets/*
77
# Local development files
88
CLAUDE.md
99
CONTEXT.md
10+
.devcontainer/welcome.txt

docker-compose.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ services:
197197
node:
198198
image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:node_agent_${BRANCH_SUFFIX}
199199
environment:
200-
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL}
200+
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL:-}
201201
container_name: desktop-jenkins_agent-1-node
202202
profiles:
203203
- node
@@ -221,7 +221,7 @@ services:
221221
android:
222222
image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:android_agent_${BRANCH_SUFFIX}
223223
environment:
224-
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL}
224+
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL:-}
225225
container_name: desktop-jenkins_agent-1-android
226226
profiles:
227227
- android
@@ -266,7 +266,7 @@ services:
266266
multi:
267267
image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:node_agent_${BRANCH_SUFFIX}
268268
environment:
269-
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL}
269+
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL:-}
270270
container_name: desktop-jenkins_agent-1-multi
271271
profiles:
272272
- multi
@@ -291,7 +291,7 @@ services:
291291
golang:
292292
image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:golang_${BRANCH_SUFFIX}
293293
environment:
294-
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL}
294+
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL:-}
295295
container_name: desktop-jenkins_agent-1-golang
296296
profiles:
297297
- golang
@@ -315,7 +315,7 @@ services:
315315
cpp:
316316
image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:cpp_${BRANCH_SUFFIX}
317317
environment:
318-
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL}
318+
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL:-}
319319
container_name: desktop-jenkins_agent-1
320320
profiles:
321321
- cpp
@@ -339,7 +339,7 @@ services:
339339
dotnet:
340340
image: ${IMAGE_PREFIX}/${GHCR_USERNAME}/quickstart-tutorials/jenkinsci-tutorials:dotnet_${BRANCH_SUFFIX}
341341
environment:
342-
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL}
342+
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL:-}
343343
container_name: desktop-jenkins_agent-1
344344
profiles:
345345
- dotnet

0 commit comments

Comments
 (0)