diff --git a/.agola/config.yml b/.agola/config.yml new file mode 100644 index 0000000..6d7a106 --- /dev/null +++ b/.agola/config.yml @@ -0,0 +1,80 @@ +version: v0 +runs: + - name: Build + tasks: + - name: Checkout code + runtime: + type: pod + containers: + - image: docker.io/alpine/git + steps: + - clone: + recurse_submodules: true + - save_to_workspace: + contents: + - source_dir: . + dest_dir: . + paths: + - '**' + - name: Build Go CI image + runtime: + containers: + - image: gcr.io/kaniko-project/executor:debug + environment: + DOCKERAUTH: + from_variable: dockerauth + shell: /busybox/sh + steps: + - restore_workspace: + dest_dir: . + - run: + name: generate docker config + command: | + cat << EOF > /kaniko/.docker/config.json + { + "auths": { + "https://code.icb4dc0.de": { "auth" : "$DOCKERAUTH" } + } + } + EOF + - run: + name: Build and push image + command: | + /kaniko/executor \ + --destination code.icb4dc0.de/inetmock/ci-images/go-ci:latest \ + --context dir:///root/project/ \ + --dockerfile /root/project/go-ci/Dockerfile + depends: + - Checkout code + + + - name: Build mdbook image + runtime: + containers: + - image: gcr.io/kaniko-project/executor:debug + environment: + DOCKERAUTH: + from_variable: dockerauth + shell: /busybox/sh + steps: + - restore_workspace: + dest_dir: . + - run: + name: generate docker config + command: | + cat << EOF > /kaniko/.docker/config.json + { + "auths": { + "https://code.icb4dc0.de": { "auth" : "$DOCKERAUTH" } + } + } + EOF + - run: + name: Build and push image + command: | + /kaniko/executor \ + --destination code.icb4dc0.de/inetmock/ci-images/mdbook:latest \ + --context dir:///root/project/ \ + --dockerfile /root/project/mdbook/Dockerfile + depends: + - Checkout code \ No newline at end of file diff --git a/go-ci/Dockerfile b/go-ci/Dockerfile new file mode 100644 index 0000000..646fef3 --- /dev/null +++ b/go-ci/Dockerfile @@ -0,0 +1,46 @@ +FROM docker.io/golang:1.19-alpine + +# install basic dependencies +RUN apk add -U --no-cache \ + docker \ + protobuf-dev \ + findutils \ + git \ + git-lfs \ + ca-certificates \ + graphviz \ + gcc \ + musl-dev \ + curl \ + jq \ + libbpf \ + libbpf-dev \ + clang \ + llvm12 \ + elfutils \ + linux-headers + +# Install GoReleaser +RUN export GORELEASER_VERSION=$(curl https://api.github.com/repos/goreleaser/goreleaser/releases | jq -r '. | first |.tag_name | capture("(?[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+)") | .version') && \ + curl -Lo /tmp/goreleaser.apk "https://github.com/goreleaser/goreleaser/releases/latest/download/goreleaser_${GORELEASER_VERSION}_x86_64.apk" && \ + apk add --allow-untrusted /tmp/goreleaser.apk && \ + rm -f /tmp/*.apk && \ + goreleaser --version + +# Install go tools +RUN go install github.com/golang/mock/mockgen@latest \ + && go install google.golang.org/protobuf/cmd/protoc-gen-go@latest \ + && go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest \ + && go install github.com/Helcaraxan/gomod@latest \ + && go install gotest.tools/gotestsum@latest \ + && go install golang.org/x/tools/cmd/goimports@latest \ + && go install mvdan.cc/gofumpt@latest \ + && go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest \ + && curl -L https://github.com/go-task/task/releases/latest/download/task_linux_amd64.tar.gz | tar -xvz -C /usr/local/bin task \ + && export BUF_VERSION=$(curl https://api.github.com/repos/bufbuild/buf/releases | jq -r '. | first |.tag_name') && \ + curl -Lo /usr/bin/buf "https://github.com/bufbuild/buf/releases/download/${BUF_VERSION}/buf-Linux-x86_64" \ + && chmod +x /usr/bin/buf \ + && go version \ + && golangci-lint --version \ + && task --version \ + && buf --version diff --git a/mdbook/Dockerfile b/mdbook/Dockerfile new file mode 100644 index 0000000..346f4ec --- /dev/null +++ b/mdbook/Dockerfile @@ -0,0 +1,8 @@ +FROM ubuntu:22.04 + +ARG MDBOOK_VERSION=0.4.21 + +RUN apt update && \ + apt install -y wget && \ + apt clean all -y && \ + wget -qO- "https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz" | tar -xz -C /usr/bin/ \ No newline at end of file diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..abb2f10 --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base" + ] +} \ No newline at end of file