Skip to content

Commit 85a7c7b

Browse files
authored
Merge pull request #77 from gitpod-samples/sync-fork-commits
Sync fork commits
2 parents 16c0a79 + 1706acf commit 85a7c7b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+5539
-419
lines changed

.devcontainer/Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# syntax=docker/dockerfile:1.4
2+
FROM mcr.microsoft.com/devcontainers/typescript-node:20-bullseye
3+
4+
# Install system dependencies in a single layer
5+
RUN apt-get update && apt-get install -y --no-install-recommends \
6+
postgresql-client \
7+
&& apt-get clean \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
# Set working directory
11+
WORKDIR /workspaces/gitpodflix
12+
13+
# Install global dependencies first
14+
RUN npm install -g nodemon
15+
16+
# Create directories for package files
17+
RUN mkdir -p frontend backend/catalog
18+
19+
# Copy package files for dependency caching
20+
COPY frontend/package*.json ./frontend/
21+
COPY backend/catalog/package*.json ./backend/catalog/
22+
23+
# Install dependencies using BuildKit cache
24+
RUN --mount=type=cache,target=/root/.npm \
25+
cd frontend && npm ci --prefer-offline --no-audit --no-fund && \
26+
cd ../backend/catalog && npm ci --prefer-offline --no-audit --no-fund
27+
28+
# Copy the rest of the application
29+
COPY . .
30+
31+
# Set the default user
32+
USER node

.devcontainer/devcontainer.json

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
{
22
"name": "GitpodFlix Dev Environment",
3-
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": "..",
6+
"options": [
7+
"--build-arg", "BUILDKIT_INLINE_CACHE=1"
8+
]
9+
},
410
"features": {
511
"ghcr.io/devcontainers/features/common-utils:2": {
612
"installZsh": true,
713
"configureZshAsDefaultShell": true,
8-
"installGit": true,
9-
"installGitLFS": true,
10-
"installGithubCli": true
11-
},
12-
"ghcr.io/devcontainers/features/github-cli:1": { },
13-
"ghcr.io/devcontainers/features/node:1": {
14-
"version": "18",
15-
"nodeGypDependencies": true
14+
"installGit": false,
15+
"installGitLFS": false,
16+
"installGithubCli": false
1617
},
18+
"ghcr.io/devcontainers/features/github-cli:1": {},
1719
"ghcr.io/warrenbuckley/codespace-features/sqlite:1": {},
1820
"ghcr.io/devcontainers/features/docker-in-docker:2": {
19-
"version": "latest",
20-
"moby": true
21-
},
22-
"ghcr.io/devcontainers-extra/features/renovate-cli:2": {},
23-
"ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {}
21+
"version": "20.10",
22+
"moby": false
23+
}
2424
},
2525
"forwardPorts": [
2626
3000,
2727
3001,
2828
5432
2929
],
3030
"postCreateCommand": ".devcontainer/setup.sh",
31+
"postStartCommand": "./startup.sh",
3132
"customizations": {
3233
"vscode": {
3334
"extensions": [
34-
35-
// Install AI code assistants
3635
"GitHub.copilot",
3736
"RooVeterinaryInc.roo-cline",
3837
"saoudrizwan.claude-dev",
39-
40-
// Install other extensions
4138
"dbaeumer.vscode-eslint",
4239
"esbenp.prettier-vscode",
4340
"mtxr.sqltools",
4441
"mtxr.sqltools-driver-sqlite",
45-
"mtxr.sqltools-driver-mysql",
42+
"mtxr.sqltools-driver-pg",
4643
"bradlc.vscode-tailwindcss"
47-
4844
],
4945
"settings": {
50-
"editor.formatOnSave": true
46+
"editor.formatOnSave": true,
47+
"editor.codeActionsOnSave": {
48+
"source.fixAll.eslint": true
49+
},
50+
"typescript.preferences.importModuleSpecifier": "relative"
5151
}
5252
}
5353
},
@@ -63,5 +63,11 @@
6363
"label": "PostgreSQL"
6464
}
6565
},
66-
"remoteUser": "root"
66+
"remoteUser": "node",
67+
"mounts": [
68+
"source=gitpodflix-node-modules,target=${containerWorkspaceFolder}/node_modules,type=volume",
69+
"source=gitpodflix-frontend-node-modules,target=${containerWorkspaceFolder}/frontend/node_modules,type=volume",
70+
"source=gitpodflix-catalog-node-modules,target=${containerWorkspaceFolder}/backend/catalog/node_modules,type=volume",
71+
"source=gitpodflix-npm-cache,target=/root/.npm,type=volume"
72+
]
6773
}

.devcontainer/setup.sh

Lines changed: 62 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,83 @@
11
#!/bin/bash
22

3-
# Exit on error
43
set -e
54

65
echo "🚀 Starting development environment setup..."
76

8-
# Function to handle package installation
9-
install_package() {
10-
local package=$1
11-
echo "📦 Installing $package..."
12-
if ! dpkg -l | grep -q "^ii $package "; then
13-
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends "$package"
14-
else
15-
echo "$package is already installed"
16-
fi
17-
}
18-
19-
# Clean apt cache and update package lists
20-
echo "🧹 Cleaning apt cache..."
21-
apt-get clean
22-
echo "🔄 Updating package lists..."
23-
apt-get update
24-
25-
# Install system dependencies one by one with error handling
26-
echo "📦 Installing system dependencies..."
27-
install_package "mariadb-client"
28-
install_package "mariadb-server"
29-
install_package "postgresql-client"
30-
31-
# Verify PostgreSQL client tools are installed
7+
# Verify PostgreSQL client tools are installed (already installed in Dockerfile)
328
if ! command -v pg_isready &> /dev/null; then
339
echo "❌ PostgreSQL client tools not properly installed"
3410
exit 1
3511
fi
3612

37-
# Start MariaDB service
38-
echo "💾 Starting MariaDB service..."
39-
if ! service mariadb status > /dev/null 2>&1; then
40-
service mariadb start
41-
else
42-
echo "✅ MariaDB service is already running"
43-
fi
44-
45-
# Verify MariaDB is running
46-
if ! service mariadb status > /dev/null 2>&1; then
47-
echo "❌ Failed to start MariaDB service"
48-
exit 1
49-
fi
50-
51-
# Install global npm packages
52-
echo "📦 Installing global npm packages..."
53-
npm install -g nodemon
54-
55-
# Install project dependencies
56-
echo "📦 Installing project dependencies..."
57-
58-
# Install Gitpod Flix dependencies
59-
if [ -d "/workspaces/gitpodflix-demo/frontend" ]; then
60-
echo "📦 Installing Gitpod Flix dependencies..."
61-
cd /workspaces/gitpodflix-demo/frontend
62-
npm install
13+
# Install jq if not present (for health checks)
14+
if ! command -v jq &> /dev/null; then
15+
echo "📦 Installing jq for JSON processing..."
16+
sudo apt-get update && sudo apt-get install -y jq
6317
fi
6418

65-
# Install catalog service dependencies
66-
if [ -d "/workspaces/gitpodflix-demo/backend/catalog" ]; then
67-
echo "📦 Installing catalog service dependencies..."
68-
cd /workspaces/gitpodflix-demo/backend/catalog
69-
npm install
70-
fi
19+
# Make scripts executable
20+
chmod +x startup.sh 2>/dev/null || true
21+
chmod +x health-check.sh 2>/dev/null || true
7122

7223
echo "✅ Setup completed successfully!"
7324

25+
# GitHub CLI authentication (optional)
7426
if [ -n "$GH_CLI_TOKEN" ]; then
7527
gh auth login --with-token <<< "$GH_CLI_TOKEN"
76-
# Configure git to use GitHub CLI credentials
7728
gh auth setup-git
7829
else
79-
echo "GH_CLI_TOKEN not set, skipping authentication"
30+
echo "ℹ️ GH_CLI_TOKEN not set, skipping authentication"
8031
fi
32+
33+
echo "🔧 Available commands:"
34+
echo " ./startup.sh - Start all services"
35+
echo " ./health-check.sh - Check service health"
36+
37+
# Setup Jira MCP server
38+
echo "🚀 Setting up Jira MCP server..."
39+
40+
# Create config directory
41+
mkdir -p ~/.config/gitpod
42+
43+
# Clone and build Jira MCP if not already present
44+
if [ ! -d "/home/node/jira-mcp" ]; then
45+
echo "📦 Cloning Jira MCP repository..."
46+
cd /home/node
47+
git clone https://github.com/MankowskiNick/jira-mcp.git
48+
cd jira-mcp
49+
echo "📦 Installing dependencies..."
50+
npm install
51+
echo "🔨 Building project..."
52+
npm run build
53+
else
54+
echo "✓ Jira MCP already installed"
55+
fi
56+
57+
# Create MCP configuration file
58+
echo "⚙️ Creating MCP configuration..."
59+
cat > ~/.config/gitpod/mcp-config.json << EOF
60+
{
61+
"mcpServers": {
62+
"jira-mcp": {
63+
"command": "node",
64+
"args": ["/home/node/jira-mcp/build/index.js"],
65+
"env": {
66+
"JIRA_HOST": "${JIRA_HOST:-coakley.atlassian.net}",
67+
"JIRA_USERNAME": "${JIRA_USERNAME:-joe@gitpod.io}",
68+
"JIRA_API_TOKEN": "${JIRA_API_TOKEN:-your_api_token_here}",
69+
"JIRA_PROJECT_KEY": "${JIRA_PROJECT_KEY:-MBA}",
70+
"AUTO_CREATE_TEST_TICKETS": "true",
71+
"JIRA_ACCEPTANCE_CRITERIA_FIELD": "customfield_10429",
72+
"JIRA_STORY_POINTS_FIELD": "customfield_10040",
73+
"JIRA_EPIC_LINK_FIELD": "customfield_10014"
74+
}
75+
}
76+
}
77+
}
78+
EOF
79+
80+
echo "✅ Jira MCP server setup complete!"
81+
echo "📍 Configuration: ~/.config/gitpod/mcp-config.json"
82+
echo "📍 Server location: /home/node/jira-mcp/"
83+
echo "🎯 Project: MBA (coakley.atlassian.net)"

.dockerignore

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Dependencies
2+
node_modules
3+
*/node_modules
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Build outputs
9+
dist
10+
build
11+
.next
12+
.nuxt
13+
.vite
14+
15+
# Environment files
16+
.env
17+
.env.local
18+
.env.development.local
19+
.env.test.local
20+
.env.production.local
21+
22+
# IDE and editor files
23+
.vscode
24+
.idea
25+
*.swp
26+
*.swo
27+
*~
28+
29+
# OS generated files
30+
.DS_Store
31+
.DS_Store?
32+
._*
33+
.Spotlight-V100
34+
.Trashes
35+
ehthumbs.db
36+
Thumbs.db
37+
38+
# Git
39+
.git
40+
.gitignore
41+
42+
# Docker
43+
Dockerfile*
44+
docker-compose*
45+
.dockerignore
46+
47+
# Logs
48+
logs
49+
*.log
50+
51+
# Runtime data
52+
pids
53+
*.pid
54+
*.seed
55+
*.pid.lock
56+
57+
# Coverage directory used by tools like istanbul
58+
coverage
59+
*.lcov
60+
61+
# Temporary folders
62+
tmp
63+
temp
64+
65+
# Optional npm cache directory
66+
.npm
67+
68+
# Optional eslint cache
69+
.eslintcache
70+
71+
# Microbundle cache
72+
.rpt2_cache/
73+
.rts2_cache_cjs/
74+
.rts2_cache_es/
75+
.rts2_cache_umd/
76+
77+
# Optional REPL history
78+
.node_repl_history
79+
80+
# Output of 'npm pack'
81+
*.tgz
82+
83+
# Yarn Integrity file
84+
.yarn-integrity
85+
86+
# parcel-bundler cache (https://parceljs.org/)
87+
.cache
88+
.parcel-cache
89+
90+
# Stores VSCode versions used for testing VSCode extensions
91+
.vscode-test
92+
93+
# Yarn v2
94+
.yarn/cache
95+
.yarn/unplugged
96+
.yarn/build-state.yml
97+
.yarn/install-state.gz
98+
.pnp.*

0 commit comments

Comments
 (0)