From f3c6473e83b532862ca94aa684bd0a287263c061 Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Halili Date: Thu, 3 Oct 2024 16:20:26 +0000 Subject: [PATCH] chore(gitpod): migrate Classic Gitpod config to devcontainers Spoiler: Gitpod tasks are now under the automations.yaml file, along side support for services in Gitpod Flex. :) Signed-off-by: Andrei Jiroh Halili --- .devcontainer/Dockerfile | 29 +++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 31 +++++++++++++++++++++++++++++++ .gitpod/automations.yaml | 5 +++++ 3 files changed, 65 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .gitpod/automations.yaml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..b87dc10 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,29 @@ +# syntax=docker/dockerfile:1 +FROM gitpod/workspace-full:latest as workspace + +WORKDIR /tmp +# setup work for scdoc and hut cli +RUN git clone https://git.sr.ht/~sircmpwn/scdoc && cd scdoc \ + && make && sudo cp scdoc /usr/local/bin/scdoc && cd .. \ + && git clone https://git.sr.ht/~emersion/hut && cd hut \ + && make PREFIX=/home/gitpod/.local && sudo cp ./hut /usr/local/bin/hut \ + && sudo rm -rv /tmp/* + +# https://squidfunk.github.io/mkdocs-material/setup/setting-up-social-cards/#linux +RUN sudo install-packages \ + libcairo2-dev \ + libfreetype6-dev \ + libffi-dev \ + libjpeg-dev \ + libpng-dev \ + libz-dev + +# https://docs.docker.com/build/install-buildx/ +COPY --from=docker/buildx-bin:latest /buildx /usr/libexec/docker/cli-plugins/docker-buildx + +# brew maintenance + install ShellCheck and Hadolint +WORKDIR /home/gitpod +RUN brew update && brew upgrade \ + && brew install hadolint shellcheck \ + && npm i -g wrangler \ + && git -C ~/.pyenv pull origin master diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f90d03a --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,31 @@ +// The Dev Container format allows you to configure your environment. At the heart of it +// is a Docker image or Dockerfile which controls the tools available in your environment. +// +// See https://aka.ms/devcontainer.json for more information. +{ + "name": "Gitpod", + // Use "image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu", + // instead of the build to use a pre-built image. + "build": { + "context": ".", + "dockerfile": "Dockerfile" + }, + // Features add additional features to your environment. See https://containers.dev/features + // Beware: features are not supported on all platforms and may have unintended side-effects. + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": {} + }, + "remoteUser": "gitpod", + "customizations": { + "vscode": { + "extensions": [ + "foam.foam-vscode", + "DavidAnson.vscode-markdownlint", + "timonwong.shellcheck", + "ms-azuretools.vscode-docker", + "vivaxy.vscode-conventional-commits", + "akosyakov.gitpod-monitor" + ] + } + } +} diff --git a/.gitpod/automations.yaml b/.gitpod/automations.yaml new file mode 100644 index 0000000..2f2b81a --- /dev/null +++ b/.gitpod/automations.yaml @@ -0,0 +1,5 @@ +tasks: + devserver: + name: Run dev server + command: pipenv install && pipenv run dev + triggeredBy: [manual,postDevcontainerStart]