From 77225a477f06870dc3a0ac4ee00e9c5475934af3 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 | 12 +++++++++++ .../fresh_container/devcontainer.json | 20 +++++++++++++++++++ .../prebuilt_container/devcontainer.json | 16 +++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 7 +++++++ 4 files changed, 55 insertions(+) create mode 100644 .devcontainer/fresh_container/Dockerfile create mode 100644 .devcontainer/fresh_container/devcontainer.json create mode 100644 .devcontainer/prebuilt_container/devcontainer.json diff --git a/.devcontainer/fresh_container/Dockerfile b/.devcontainer/fresh_container/Dockerfile new file mode 100644 index 000000000..272f3a604 --- /dev/null +++ b/.devcontainer/fresh_container/Dockerfile @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: 2024 SUSE LLC +# +# SPDX-License-Identifier: Apache-2.0 + +FROM mcr.microsoft.com/devcontainers/go:1.20 +WORKDIR /build +ENV GOMODCACHE=/opt/golang/ +RUN wget https://raw.githubusercontent.com/uyuni-project/uyuni-tools/main/go.mod +RUN wget https://raw.githubusercontent.com/uyuni-project/uyuni-tools/main/go.sum +RUN go mod download +RUN rm go.mod +RUN rm go.sum diff --git a/.devcontainer/fresh_container/devcontainer.json b/.devcontainer/fresh_container/devcontainer.json new file mode 100644 index 000000000..2d10caf1e --- /dev/null +++ b/.devcontainer/fresh_container/devcontainer.json @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: 2024 SUSE LLC +// +// SPDX-License-Identifier: Apache-2.0 +{ + "name": "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" +} diff --git a/.devcontainer/prebuilt_container/devcontainer.json b/.devcontainer/prebuilt_container/devcontainer.json new file mode 100644 index 000000000..05978ff53 --- /dev/null +++ b/.devcontainer/prebuilt_container/devcontainer.json @@ -0,0 +1,16 @@ +// SPDX-FileCopyrightText: 2024 SUSE LLC +// +// SPDX-License-Identifier: Apache-2.0 +{ + "name": "Prebuilt", + "image": "docker.io/mbussolotto/uyuni-tools-dev:latest", + + // 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" +} diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 55875dcd1..1fe433ca5 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