From dd39b2be6449ecc83b92fbac9a8983afe330093b Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 27 Oct 2022 09:18:49 +0100 Subject: [PATCH] Add VSCode devcontainers Should be useful for getting a development environment setup quickly. --- .devcontainer/devcontainer.json | 10 ++++++++++ .devcontainer/on-create-command.sh | 10 ++++++++++ .devcontainer/ubuntu18.04/devcontainer.json | 10 ++++++++++ .gitignore | 3 ++- 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/on-create-command.sh create mode 100644 .devcontainer/ubuntu18.04/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..359aff0fd0 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,10 @@ +{ + "name": "Homebrew/brew", + "image": "ghcr.io/homebrew/brew:latest", + "workspaceFolder": "/home/linuxbrew/.linuxbrew/Homebrew", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/linuxbrew/.linuxbrew/Homebrew,type=bind,consistency=cached", + "onCreateCommand": ".devcontainer/on-create-command.sh", + "remoteEnv": { + "HOMEBREW_GITHUB_API_TOKEN": "${localEnv:GITHUB_TOKEN}" + } +} diff --git a/.devcontainer/on-create-command.sh b/.devcontainer/on-create-command.sh new file mode 100755 index 0000000000..d457534b29 --- /dev/null +++ b/.devcontainer/on-create-command.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + +sudo apt-get update +sudo apt-get install -y \ + -o Dpkg::Options::=--force-confdef \ + -o Dpkg::Options::=--force-confnew \ + zsh \ + shellcheck \ + zsh-autosuggestions diff --git a/.devcontainer/ubuntu18.04/devcontainer.json b/.devcontainer/ubuntu18.04/devcontainer.json new file mode 100644 index 0000000000..9e2f7d5276 --- /dev/null +++ b/.devcontainer/ubuntu18.04/devcontainer.json @@ -0,0 +1,10 @@ +{ + "name": "Homebrew/brew-ubuntu18.04", + "image": "ghcr.io/homebrew/ubuntu18.04:latest", + "workspaceFolder": "/home/linuxbrew/.linuxbrew/Homebrew", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/linuxbrew/.linuxbrew/Homebrew,type=bind,consistency=cached", + "onCreateCommand": ".devcontainer/on-create-command.sh", + "remoteEnv": { + "HOMEBREW_GITHUB_API_TOKEN": "${localEnv:GITHUB_TOKEN}" + } +} diff --git a/.gitignore b/.gitignore index 10401ee27f..09e89c2216 100644 --- a/.gitignore +++ b/.gitignore @@ -171,7 +171,8 @@ # Unignore our `brew` script. !/bin/brew -# Unignore our documentation/completions. +# Unignore our configuration/completions/documentation. +!/.devcontainer !/.github !/completions !/docs