Skip to content

Commit 083fa0a

Browse files
authored
Initial commit
0 parents  commit 083fa0a

25 files changed

+3961
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/ubuntu/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Ubuntu version (use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon): ubuntu-22.04, ubuntu-20.04, ubuntu-18.04
4+
ARG VARIANT="jammy"
5+
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
6+
7+
# Install additional OS packages, if needed.
8+
RUN apt-get update \
9+
&& apt-get install -y --no-install-recommends ca-certificates
10+
11+
# zScaler certificate, for all busy engineers
12+
ADD zscaler.pem /usr/local/share/ca-certificates/zscaler.crt
13+
RUN sudo chmod 644 /usr/local/share/ca-certificates/zscaler.crt && sudo update-ca-certificates
14+
15+
# Set the environment variable NODE_EXTRA_CA_CERTS to the zScaler certificate
16+
ENV NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/zscaler.crt
17+
18+
# [Optional] Uncomment this section to install additional OS packages.
19+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
20+
# && apt-get -y install protobuf-compiler

.devcontainer/devcontainer.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "zeiss/template-go",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
6+
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
7+
"args": {
8+
"VARIANT": "ubuntu-22.04"
9+
}
10+
},
11+
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
12+
"postCreateCommand": "bash scripts/postCreateCommand.sh",
13+
"features": {
14+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
15+
"ghcr.io/devcontainers/features/go:1": {}
16+
},
17+
"customizations": {
18+
"vscode": {
19+
"extensions": [
20+
"GitHub.copilot",
21+
"GitHub.vscode-github-actions",
22+
"golang.go",
23+
"ms-vscode.makefile-tools"
24+
]
25+
}
26+
}
27+
}

.devcontainer/zscaler.pem

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIE0zCCA7ugAwIBAgIJANu+mC2Jt3uTMA0GCSqGSIb3DQEBCwUAMIGhMQswCQYD
3+
VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIU2FuIEpvc2Ux
4+
FTATBgNVBAoTDFpzY2FsZXIgSW5jLjEVMBMGA1UECxMMWnNjYWxlciBJbmMuMRgw
5+
FgYDVQQDEw9ac2NhbGVyIFJvb3QgQ0ExIjAgBgkqhkiG9w0BCQEWE3N1cHBvcnRA
6+
enNjYWxlci5jb20wHhcNMTQxMjE5MDAyNzU1WhcNNDIwNTA2MDAyNzU1WjCBoTEL
7+
MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExETAPBgNVBAcTCFNhbiBK
8+
b3NlMRUwEwYDVQQKEwxac2NhbGVyIEluYy4xFTATBgNVBAsTDFpzY2FsZXIgSW5j
9+
LjEYMBYGA1UEAxMPWnNjYWxlciBSb290IENBMSIwIAYJKoZIhvcNAQkBFhNzdXBw
10+
b3J0QHpzY2FsZXIuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
11+
qT7STSxZRTgEFFf6doHajSc1vk5jmzmM6BWuOo044EsaTc9eVEV/HjH/1DWzZtcr
12+
fTj+ni205apMTlKBW3UYR+lyLHQ9FoZiDXYXK8poKSV5+Tm0Vls/5Kb8mkhVVqv7
13+
LgYEmvEY7HPY+i1nEGZCa46ZXCOohJ0mBEtB9JVlpDIO+nN0hUMAYYdZ1KZWCMNf
14+
5J/aTZiShsorN2A38iSOhdd+mcRM4iNL3gsLu99XhKnRqKoHeH83lVdfu1XBeoQz
15+
z5V6gA3kbRvhDwoIlTBeMa5l4yRdJAfdpkbFzqiwSgNdhbxTHnYYorDzKfr2rEFM
16+
dsMU0DHdeAZf711+1CunuQIDAQABo4IBCjCCAQYwHQYDVR0OBBYEFLm33UrNww4M
17+
hp1d3+wcBGnFTpjfMIHWBgNVHSMEgc4wgcuAFLm33UrNww4Mhp1d3+wcBGnFTpjf
18+
oYGnpIGkMIGhMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8G
19+
A1UEBxMIU2FuIEpvc2UxFTATBgNVBAoTDFpzY2FsZXIgSW5jLjEVMBMGA1UECxMM
20+
WnNjYWxlciBJbmMuMRgwFgYDVQQDEw9ac2NhbGVyIFJvb3QgQ0ExIjAgBgkqhkiG
21+
9w0BCQEWE3N1cHBvcnRAenNjYWxlci5jb22CCQDbvpgtibd7kzAMBgNVHRMEBTAD
22+
AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAw0NdJh8w3NsJu4KHuVZUrmZgIohnTm0j+
23+
RTmYQ9IKA/pvxAcA6K1i/LO+Bt+tCX+C0yxqB8qzuo+4vAzoY5JEBhyhBhf1uK+P
24+
/WVWFZN/+hTgpSbZgzUEnWQG2gOVd24msex+0Sr7hyr9vn6OueH+jj+vCMiAm5+u
25+
kd7lLvJsBu3AO3jGWVLyPkS3i6Gf+rwAp1OsRrv3WnbkYcFf9xjuaf4z0hRCrLN2
26+
xFNjavxrHmsH8jPHVvgc1VD0Opja0l/BRVauTrUaoW6tE+wFG5rEcPGS80jjHK4S
27+
pB5iDj2mUZH1T8lzYtuZy0ZPirxmtsk3135+CKNa2OCAhhFjE0xd
28+
-----END CERTIFICATE-----

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
insert_final_newline = false
15+
trim_trailing_whitespace = false
16+
17+
[{Makefile,**.mk}]
18+
# Use tabs for indentation (Makefiles require tabs)
19+
indent_style = tab

.envrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
SCRIPT=`python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "${BASH_SOURCE:-$0}"`
3+
4+
export PROJECT_DIR=$(dirname $SCRIPT)
5+
export GO111MODULE=on
6+
export DOCKER_HOST_IP=127.0.0.1
7+
export GOPROXY=direct
8+
export PATH=$PATH:$PWD/bin

.envsh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
SCRIPT=`python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" "${BASH_SOURCE:-$0}"`
3+
4+
export PROJECT_DIR=$(dirname $SCRIPT)
5+
export GO111MODULE=on
6+
export DOCKER_HOST_IP=127.0.0.1
7+
export GOPROXY=direct
8+
export PATH=$PATH:$PWD/bin

.gitattributes

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Automatically normalize line endings for all text-based files
2+
# http://git-scm.com/docs/gitattributes#_end_of_line_conversion
3+
* text=auto
4+
5+
# For the following file types, normalize line endings to LF on
6+
# checkin and prevent conversion to CRLF when they are checked out
7+
# (this is required in order to prevent newline related issues like,
8+
# for example, after the build script is run)
9+
.* text eol=lf
10+
*.css text eol=lf
11+
*.html text eol=lf
12+
*.js text eol=lf
13+
*.json text eol=lf
14+
*.md text eol=lf
15+
*.sh text eol=lf
16+
*.txt text eol=lf
17+
*.xml text eol=lf

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "04:00"
8+
open-pull-requests-limit: 10
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"
13+
- package-ecosystem: gomod
14+
directory: "/tools"
15+
schedule:
16+
interval: daily
17+
time: "04:00"
18+
open-pull-requests-limit: 10

.github/workflows/automerge.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# .github/workflows/automerge.yml
2+
3+
name: Dependabot (auto-merge)
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- main
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
dependabot:
16+
runs-on: ubuntu-latest
17+
if: ${{ github.actor == 'dependabot[bot]' }}
18+
steps:
19+
- name: Enable auto-merge for Dependabot PRs
20+
run: gh pr merge --auto --merge "$PR_URL"
21+
env:
22+
PR_URL: ${{github.event.pull_request.html_url}}
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/main.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# .github/workflows/main.yml
2+
3+
name: Test & Lint
4+
5+
on:
6+
workflow_call:
7+
push:
8+
branches:
9+
- main
10+
- release/*
11+
pull_request:
12+
branches:
13+
- main
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
checks: write
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-go@v5
23+
with:
24+
go-version-file: ./go.mod
25+
- run: make test
26+
- uses: dorny/test-reporter@v1
27+
if: success() || failure()
28+
with:
29+
name: Go Test Results
30+
path: .test/reports/**-test.xml
31+
reporter: java-junit
32+
fail-on-error: 'true'
33+
- uses: actions/upload-artifact@v4
34+
if: success() || failure()
35+
with:
36+
name: Test Reports
37+
path: .test/reports/**
38+
39+
lint:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: actions/setup-go@v5
44+
with:
45+
go-version-file: ./go.mod
46+
check-latest: true
47+
- run: make lint

0 commit comments

Comments
 (0)