Repository navigation
feat: rewrite as Go CLI with containers and #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| { | ||
| "name": "Go Dev Environment", | ||
| "build": { | ||
| "dockerfile": "../containers/go/Dockerfile", | ||
| "context": ".." | ||
| }, | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "golang.go", | ||
| "GitHub.copilot" | ||
| ], | ||
| "settings": { | ||
| "go.toolsManagement.autoUpdate": true, | ||
| "go.useLanguageServer": true, | ||
| "go.lintTool": "golangci-lint", | ||
| "go.lintOnSave": "workspace", | ||
| "editor.formatOnSave": true, | ||
| "[go]": { | ||
| "editor.defaultFormatter": "golang.go", | ||
| "editor.codeActionsOnSave": { | ||
| "source.organizeImports": true | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "mounts": [ | ||
| "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached" | ||
| ], | ||
| "workspaceFolder": "/workspace", | ||
| "forwardPorts": [8080, 2345], | ||
| "portsAttributes": { | ||
| "8080": { | ||
| "label": "Application", | ||
| "onAutoForward": "notify" | ||
| }, | ||
| "2345": { | ||
| "label": "Debug (delve)", | ||
| "onAutoForward": "silent" | ||
| } | ||
| }, | ||
| "postCreateCommand": "echo 'Go environment ready!'", | ||
| "remoteUser": "root", | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/git:1": {} | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| { | ||
| "name": "Python Dev Environment", | ||
| "build": { | ||
| "dockerfile": "../containers/python/Dockerfile", | ||
| "context": ".." | ||
| }, | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "ms-python.python", | ||
| "ms-python.vscode-pylance", | ||
| "charliermarsh.ruff", | ||
| "ms-python.debugpy" | ||
| ], | ||
| "settings": { | ||
| "python.defaultInterpreterPath": "/usr/local/bin/python3", | ||
| "python.linting.enabled": true, | ||
| "python.linting.ruffEnabled": true, | ||
| "python.formatting.provider": "ruff", | ||
| "editor.formatOnSave": true, | ||
| "editor.codeActionsOnSave": { | ||
| "source.organizeImports": true | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "mounts": [ | ||
| "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached" | ||
| ], | ||
| "workspaceFolder": "/workspace", | ||
| "forwardPorts": [8000, 5678], | ||
| "portsAttributes": { | ||
| "8000": { | ||
| "label": "Application", | ||
| "onAutoForward": "notify" | ||
| }, | ||
| "5678": { | ||
| "label": "Debug", | ||
| "onAutoForward": "silent" | ||
| } | ||
| }, | ||
| "postCreateCommand": "echo 'Python environment ready!'", | ||
| "remoteUser": "root", | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/git:1": {} | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| { | ||
| "name": "Rust Dev Environment", | ||
| "build": { | ||
| "dockerfile": "../containers/rust/Dockerfile", | ||
| "context": ".." | ||
| }, | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "rust-lang.rust-analyzer", | ||
| "vadimcn.vscode-lldb", | ||
| "serayuzgur.crates" | ||
| ], | ||
| "settings": { | ||
| "rust-analyzer.checkOnSave.command": "clippy", | ||
| "rust-analyzer.cargo.allFeatures": true, | ||
| "editor.formatOnSave": true, | ||
| "[rust]": { | ||
| "editor.defaultFormatter": "rust-lang.rust-analyzer" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "mounts": [ | ||
| "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached" | ||
| ], | ||
| "workspaceFolder": "/workspace", | ||
| "forwardPorts": [8080, 5000], | ||
| "portsAttributes": { | ||
| "8080": { | ||
| "label": "Application", | ||
| "onAutoForward": "notify" | ||
| }, | ||
| "5000": { | ||
| "label": "Debug", | ||
| "onAutoForward": "silent" | ||
| } | ||
| }, | ||
| "postCreateCommand": "echo 'Rust environment ready!'", | ||
| "remoteUser": "root", | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/git:1": {} | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| { | ||
| "name": "Web Dev Environment", | ||
| "build": { | ||
| "dockerfile": "../containers/web/Dockerfile", | ||
| "context": ".." | ||
| }, | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "dbaeumer.vscode-eslint", | ||
| "esbenp.prettier-vscode", | ||
| "bradlc.vscode-tailwindcss", | ||
| "Vue.volar", | ||
| "ms-vscode.vscode-typescript-next" | ||
| ], | ||
| "settings": { | ||
| "editor.formatOnSave": true, | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "editor.codeActionsOnSave": { | ||
| "source.fixAll.eslint": true | ||
| }, | ||
| "eslint.validate": [ | ||
| "javascript", | ||
| "javascriptreact", | ||
| "typescript", | ||
| "typescriptreact", | ||
| "vue" | ||
| ], | ||
| "typescript.tsdk": "node_modules/typescript/lib" | ||
| } | ||
| } | ||
| }, | ||
| "mounts": [ | ||
| "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached" | ||
| ], | ||
| "workspaceFolder": "/workspace", | ||
| "forwardPorts": [3000, 5173, 9229], | ||
| "portsAttributes": { | ||
| "3000": { | ||
| "label": "Next.js/React", | ||
| "onAutoForward": "notify" | ||
| }, | ||
| "5173": { | ||
| "label": "Vite", | ||
| "onAutoForward": "notify" | ||
| }, | ||
| "9229": { | ||
| "label": "Debug", | ||
| "onAutoForward": "silent" | ||
| } | ||
| }, | ||
| "postCreateCommand": "echo 'Web environment ready!'", | ||
| "remoteUser": "root", | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/git:1": {} | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, test] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| # Lint and test Go code | ||
| go-checks: | ||
| name: Go Checks | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.24.x' | ||
|
|
||
| - name: Go mod download | ||
| run: go mod download | ||
|
|
||
| - name: Run gofmt | ||
| run: | | ||
| if [ -n "$(gofmt -l .)" ]; then | ||
| echo "Go code is not formatted:" | ||
| gofmt -d . | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Run go vet | ||
| run: go vet ./... | ||
|
|
||
| - name: Run go test | ||
| run: go test -v ./... | ||
|
|
||
| - name: Build CLI | ||
| run: go build -o bin/dev ./cmd/dev | ||
|
|
||
| # Lint shell scripts | ||
| shell-checks: | ||
| name: Shell Script Checks | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install shellcheck | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y shellcheck | ||
|
|
||
| - name: Install shfmt | ||
| run: | | ||
| wget -O /tmp/shfmt https://github.com/mvdan/sh/releases/download/v3.8.0/shfmt_v3.8.0_linux_amd64 | ||
| chmod +x /tmp/shfmt | ||
| sudo mv /tmp/shfmt /usr/local/bin/ | ||
|
|
||
| - name: Run shellcheck on scripts | ||
| run: | | ||
| find . -name "*.sh" -o -path "./runs/*" -type f -executable | while read -r file; do | ||
| if file "$file" | grep -q "shell script"; then | ||
| echo "Checking $file" | ||
| shellcheck "$file" || true | ||
| fi | ||
| done | ||
|
|
||
| - name: Run shfmt on scripts | ||
| run: | | ||
| find . -name "*.sh" -o -path "./runs/*" -type f -executable | while read -r file; do | ||
| if file "$file" | grep -q "shell script"; then | ||
| echo "Checking format: $file" | ||
| shfmt -d "$file" || true | ||
| fi | ||
| done | ||
|
|
||
| # Validate manifests | ||
| manifest-checks: | ||
| name: Manifest Validation | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Validate YAML syntax | ||
| run: | | ||
| for file in manifests/*.yaml manifests/presets/*.yaml; do | ||
| if [ -f "$file" ]; then | ||
| echo "Validating $file" | ||
| python3 -c "import yaml; yaml.safe_load(open('$file'))" || exit 1 | ||
| fi | ||
| done | ||
|
|
||
| # Build preset containers | ||
| build-containers: | ||
| name: Build ${{ matrix.preset }} container | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| preset: [python, go, rust, web] | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Build ${{ matrix.preset }} image | ||
| run: | | ||
| docker build \ | ||
| -t dev-env-${{ matrix.preset }}:ci \ | ||
| -f containers/${{ matrix.preset }}/Dockerfile \ | ||
| containers/${{ matrix.preset }}/ | ||
|
|
||
| - name: Run smoke test | ||
| run: | | ||
| case "${{ matrix.preset }}" in | ||
| python) | ||
| docker run --rm dev-env-${{ matrix.preset }}:ci python3 --version | ||
| ;; | ||
| go) | ||
| docker run --rm dev-env-${{ matrix.preset }}:ci go version | ||
| ;; | ||
| rust) | ||
| docker run --rm dev-env-${{ matrix.preset }}:ci rustc --version | ||
| ;; | ||
| web) | ||
| docker run --rm dev-env-${{ matrix.preset }}:ci node --version | ||
| ;; | ||
| esac | ||
|
|
||
| # Validate K8s manifests | ||
| k8s-checks: | ||
| name: Validate K8s for ${{ matrix.preset }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| preset: [python, go, rust, web] | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup kubectl | ||
| uses: azure/setup-kubectl@v4 | ||
|
|
||
| - name: Validate K8s manifests | ||
| run: | | ||
| if [ -d "deploy/${{ matrix.preset }}" ]; then | ||
| kubectl kustomize deploy/${{ matrix.preset }}/ > /dev/null | ||
| echo "✓ K8s manifests valid for ${{ matrix.preset }}" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,32 @@ | ||
| # Build artifacts | ||
| /bin/ | ||
| /test/ | ||
| main | ||
| /Emojicode-1.0-beta.2-Linux-x86_64/ | ||
| *.exe | ||
| *.exe~ | ||
| *.dll | ||
| *.so | ||
| *.dylib | ||
|
|
||
| # Go files | ||
| *.test | ||
| *.out | ||
| vendor/ | ||
|
|
||
| # OS files | ||
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # IDE files | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
|
|
||
| # Backup files | ||
| *.backup-* | ||
| *.bak | ||
|
|
||
| # Temporary files | ||
| *.tmp | ||
| *.log |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running the dev container as the
rootuser is not a security best practice and can lead to file permission issues on the host system when using bind mounts. Consider creating a non-root user (e.g.,vscodeordev) in the base Dockerfiles and setting that user here. For example:In your Dockerfile:
Then in
devcontainer.json:This comment applies to all
devcontainer.*.jsonfiles in this PR.