diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000000..a4e4c05a9a --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,12 @@ +ARG GOLANG_VERSION=1.25 +ARG GOLANGCI_VERSION=v2.1.0 + +FROM mcr.microsoft.com/devcontainers/go:${GOLANG_VERSION} AS go_builder +ARG GOLANGCI_VERSION +RUN GOBIN=/usr/local/go/bin go install github.com/go-task/task/v3/cmd/task@latest +RUN GOBIN=/usr/local/go/bin go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${GOLANGCI_VERSION} + +FROM mcr.microsoft.com/devcontainers/go:${GOLANG_VERSION} +ENV DEBIAN_FRONTEND=noninteractive +COPY --from=go_builder /usr/local/go/bin/task /usr/local/go/bin/task +COPY --from=go_builder /usr/local/go/bin/golangci-lint /usr/local/go/bin/golangci-lint diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 0000000000..eff5c7d150 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,17 @@ +## Task Devcontainer + +### Open Task in a container + +1. Start VS Code, run the __Dev Containers: Open Folder in Container...__ command from the Command Palette (F1) or quick actions Status bar item, and select the `task` folder you would like to open. + + +### Open Task branch or PR in an isolated container + +1. Start VS Code and run __Dev Containers: Clone Repository in Container Volume...__ or from the Command Palette + +2. Enter https://github.com/go-task/task or a GitHub PR URL (e.g. https://github.com/go-task/task/pull/1067) in the input box that appears and press Enter. + + +### More Info + +Developing inside a Container : https://code.visualstudio.com/docs/devcontainers/containers diff --git a/.devcontainer/devcontainer.env b/.devcontainer/devcontainer.env new file mode 100644 index 0000000000..b5a897eebf --- /dev/null +++ b/.devcontainer/devcontainer.env @@ -0,0 +1,11 @@ + +# Experiments +TASK_X_ENV_PRECEDENCE=0 +TASK_X_GENTLE_FORCE=0 +TASK_X_REMOTE_TASKFILES=0 + +# Variables +#TASK_CORE_UTILS +#TASK_OFFLINE +#TASK_REMOTE_DIR=./.task +#TASK_TEMP_DIR=./.task diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..84777641fa --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,28 @@ +{ + "name": "Task Devcontainer", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + }, + "customizations": { + "vscode": { + "extensions": [ + "editorconfig.editorconfig", + "golang.go", + "streetsidesoftware.code-spell-checker", + "task.vscode-task" + ] + } + }, + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "moby": false + }, + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/devcontainers/features/node:1": {} + }, + "runArgs": [ + "--env-file", ".devcontainer/devcontainer.env" + ] +}