Skip to content

Commit 3e46a85

Browse files
akosyakovcsweichel
authored andcommitted
Fix devcontainer configuration drift
- Remove inaccessible shfmt feature that was causing build failures - Specify exact runtime versions (Go 1.24, Node 18) for consistency - Move leeway installation from postStartCommand to Dockerfile for proper global dependency management - Add port forwarding configuration (8080, 3000, 9000) with descriptions - Create comprehensive automations file with development workflows: - install-deps: Download Go dependencies (auto-triggered) - build-leeway: Build main application (manual) - test: Run Go tests (manual) - lint: Run linter if available (manual) - Remove obsolete install-leeway.sh script Fixes dev container build failure and establishes proper development environment following Gitpod development setup guidelines.
1 parent 0d104b5 commit 3e46a85

File tree

4 files changed

+83
-35
lines changed

4 files changed

+83
-35
lines changed

.devcontainer/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM mcr.microsoft.com/devcontainers/base:ubuntu
2+
3+
# Install leeway build tool
4+
RUN bash -c 'set -euo pipefail && \
5+
LATEST_LEEWAY_VERSION=$(curl -s https://api.github.com/repos/gitpod-io/leeway/releases/latest | jq -r ".tag_name" | sed "s/^v//") && \
6+
echo "Installing leeway version: $LATEST_LEEWAY_VERSION" && \
7+
curl -L -o /tmp/leeway.tar.gz "https://github.com/gitpod-io/leeway/releases/download/v${LATEST_LEEWAY_VERSION}/leeway_Linux_x86_64.tar.gz" && \
8+
tar -xzf /tmp/leeway.tar.gz -C /tmp && \
9+
install -m 755 /tmp/leeway /usr/local/bin/ && \
10+
rm /tmp/leeway.tar.gz /tmp/leeway'

.devcontainer/devcontainer.json

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
11
{
22
"name": "leeway",
3-
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
46
"features": {
5-
"ghcr.io/devcontainers/features/node:1": {},
6-
"ghcr.io/devcontainers/features/go:1": {},
7-
"ghcr.io/devcontainers/features/common-utils:2": {},
8-
"ghcr.io/devcontainers-contrib/features/shfmt:1": {
9-
"version": "3.10.0"
7+
"ghcr.io/devcontainers/features/node:1": {
8+
"version": "18"
9+
},
10+
"ghcr.io/devcontainers/features/go:1": {
11+
"version": "1.24"
1012
},
13+
"ghcr.io/devcontainers/features/common-utils:2": {},
1114
"ghcr.io/dhoeric/features/google-cloud-cli:1": {},
12-
"ghcr.io/devcontainers/features/aws-cli:1": {},
15+
"ghcr.io/devcontainers/features/aws-cli:1": {}
1316
},
14-
"postStartCommand": "./.devcontainer/install-leeway.sh"
17+
"forwardPorts": [8080, 3000, 9000],
18+
"portsAttributes": {
19+
"8080": {
20+
"label": "Application Server",
21+
"onAutoForward": "notify"
22+
},
23+
"3000": {
24+
"label": "Development Server",
25+
"onAutoForward": "notify"
26+
},
27+
"9000": {
28+
"label": "Debug Server",
29+
"onAutoForward": "notify"
30+
}
31+
}
1532
}

.devcontainer/install-leeway.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

.gitpod/automations.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
tasks:
2+
install-deps:
3+
name: Install Go Dependencies
4+
description: Download and cache Go module dependencies
5+
command: |
6+
echo "Installing Go dependencies..."
7+
go mod download
8+
echo "Go dependencies installed successfully"
9+
triggeredBy:
10+
- postDevcontainerStart
11+
12+
build-leeway:
13+
name: Build Leeway Application
14+
description: Build the main leeway application
15+
command: |
16+
echo "Building leeway application..."
17+
go build -o bin/leeway .
18+
echo "Leeway application built successfully"
19+
dependsOn:
20+
- install-deps
21+
22+
test:
23+
name: Run Tests
24+
description: Run Go tests for the project
25+
command: |
26+
echo "Running tests..."
27+
go test ./...
28+
echo "Tests completed"
29+
dependsOn:
30+
- install-deps
31+
triggeredBy:
32+
- manual
33+
34+
lint:
35+
name: Run Linter
36+
description: Run golangci-lint on the codebase
37+
command: |
38+
echo "Running linter..."
39+
if command -v golangci-lint >/dev/null 2>&1; then
40+
golangci-lint run
41+
else
42+
echo "golangci-lint not available, skipping lint check"
43+
fi
44+
echo "Linting completed"
45+
dependsOn:
46+
- install-deps
47+
triggeredBy:
48+
- manual

0 commit comments

Comments
 (0)