From b66f7d7d472063d275a83e8d8f8a02206c113f1a Mon Sep 17 00:00:00 2001 From: Michele Bussolotto Date: Tue, 4 Jun 2024 11:43:42 +0200 Subject: [PATCH] Dev container --- .devcontainer/fresh_container/Dockerfile | 6 ++++ .../fresh_container/devcontainer.json | 34 +++++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 7 ++++ .gitignore | 2 -- .vscode/settings.json | 3 ++ 5 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .devcontainer/fresh_container/Dockerfile create mode 100644 .devcontainer/fresh_container/devcontainer.json create mode 100644 .vscode/settings.json diff --git a/.devcontainer/fresh_container/Dockerfile b/.devcontainer/fresh_container/Dockerfile new file mode 100644 index 000000000..3ba2c139b --- /dev/null +++ b/.devcontainer/fresh_container/Dockerfile @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: 2024 SUSE LLC +# +# SPDX-License-Identifier: Apache-2.0 + +FROM mcr.microsoft.com/devcontainers/go:1.21 +ENV GOMODCACHE=/opt/golang/ diff --git a/.devcontainer/fresh_container/devcontainer.json b/.devcontainer/fresh_container/devcontainer.json new file mode 100644 index 000000000..c876d0a09 --- /dev/null +++ b/.devcontainer/fresh_container/devcontainer.json @@ -0,0 +1,34 @@ +// SPDX-FileCopyrightText: 2024 SUSE LLC +// +// SPDX-License-Identifier: Apache-2.0 +{ + "name": "uyuni-tools-fresh", + "build": { "dockerfile": "Dockerfile" }, + + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/guiyomh/features/golangci-lint:0": {} + }, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + "remoteUser": "root", + "customizations": { + "vscode": { + "extensions": [ + "aldijav.golangwithdidi", + "golang.go", + "NeonXP.gotools", + "honnamkuan.golang-snippets", + "RVSmartPorting.rpm-spec-ext", + "ms-vscode-remote.remote-containers" + ] + } + }, + + "postCreateCommand": "cd ${containerWorkspaceFolder} && go mod download" +} diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 01616dc1b..55c9da409 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,6 +8,13 @@ SPDX-License-Identifier: Apache-2.0 **add description** +## Codespace + + +Check if you already have a running container clicking on [![Running CodeSpace](https://badgen.net/badge/Running/CodeSpace/green)](https://github.com/codespaces) + +[![Create CodeSpace](https://img.shields.io/badge/Create-CodeSpace-blue.svg)](https://codespaces.new/uyuni-project/uyuni-tools) [![About billing for Github Codespaces](https://badgen.net/badge/CodeSpace/Price)](https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces) [![CodeSpace Billing Summary](https://badgen.net/badge/CodeSpace/Billing%20Summary)](https://github.com/settings/billing/summary) [![CodeSpace Limit](https://badgen.net/badge/CodeSpace/Spending%20Limit)](https://github.com/settings/billing/spending_limit) + ## Test coverage - No tests: **add explanation** - No tests: already covered diff --git a/.gitignore b/.gitignore index ce3014886..cb751bf9e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,6 @@ # SPDX-License-Identifier: Apache-2.0 bin -.vscode/ -.idea/ vendor.tar.gz *.pyc __pycache__ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..5b41f41b8 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "gopls": { "ui.semanticTokens": true } +} \ No newline at end of file