From a424b2b202b89e18f62a75b251ceb07f52502f0f Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Fri, 13 Jan 2023 10:40:51 +0100 Subject: [PATCH] feat: initial commit --- .gitlab-ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 9 +++++++++ 2 files changed, 57 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 Dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..ffd8b04 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,48 @@ +include: +- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml' + +stages: +- build +- prepare +- release + +variables: + DOCKER_HOST: tcp://docker:2375/ + +image: buildtool/build-tools:${BUILDTOOLS_VERSION} + +build: + stage: build + services: + - docker:dind + script: + - unset BUILDTOOLS_CONTENT + - build + - push + +prepare_release: + image: node:18 + stage: prepare + before_script: + - npm install -g conventional-changelog-cli + script: + - echo "DESCRIPTION=$(conventional-changelog -p conventionalcommits)" > variables.env + artifacts: + reports: + dotenv: variables.env + rules: + - if: $CI_COMMIT_TAG + +release: + image: registry.gitlab.com/gitlab-org/release-cli:latest + stage: release + needs: + - job: prepare_release + artifacts: true + script: + - echo "Running release_job for $TAG" + release: + tag_name: '$CI_COMMIT_TAG' + description: '$DESCRIPTION' + rules: + - if: $CI_COMMIT_TAG diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..551833a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM golang:1.19 + +RUN apt update && \ + apt install -y python3 python3-pip ruby git && \ + rm -rf /var/lib/apt/lists/* && \ + go install github.com/lietu/go-pre-commit@latest && \ + go install golang.org/x/tools/cmd/goimports@latest && \ + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.1 && \ + pip install pre-commit