Skip to content

Commit c5c5afb

Browse files
authored
Merge pull request #4291 from jpkrohling/jpkrohling/move-builder
Move opentelemetry-collector-builder to core
2 parents e275dd3 + f2e9137 commit c5c5afb

28 files changed

+2063
-0
lines changed

builder/.github/CODEOWNERS

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#####################################################
2+
#
3+
# List of approvers for OpenTelemetry Collector Builder
4+
#
5+
#####################################################
6+
#
7+
# Learn about membership in OpenTelemetry community:
8+
# https://github.com/open-telemetry/community/blob/master/community-membership.md
9+
#
10+
#
11+
# Learn about CODEOWNERS file format:
12+
# https://help.github.com/en/articles/about-code-owners
13+
#
14+
15+
* @open-telemetry/collector-approvers @open-telemetry/collector-builder-approvers

builder/.github/mergify.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
pull_request_rules:
2+
- name: remove outdated reviews
3+
conditions:
4+
- base=main
5+
actions:
6+
dismiss_reviews: {}
7+
8+
- name: Automatic merge when all checks pass and the PR is approved
9+
conditions:
10+
- "#approved-reviews-by>=1"
11+
- "-draft"
12+
- "status-success=Unit tests"
13+
- "status-success=Code standards (linting)"
14+
- "status-success=Security"
15+
- "status-success=Integration test"
16+
actions:
17+
merge:
18+
method: squash
19+
commit_message: title+body

builder/.github/workflows/go.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
unit-tests:
11+
name: Unit tests
12+
runs-on: ubuntu-20.04
13+
steps:
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: 1.17
19+
20+
- name: Check out code into the Go module directory
21+
uses: actions/checkout@v2
22+
23+
- name: Test
24+
run: go test -v ./...
25+
26+
lint:
27+
name: Code standards (linting)
28+
runs-on: ubuntu-20.04
29+
steps:
30+
- name: Check out code into the Go module directory
31+
uses: actions/checkout@v2
32+
33+
- name: Lint
34+
uses: golangci/golangci-lint-action@v2
35+
with:
36+
version: v1.29
37+
args: --enable=gosec,maligned,misspell
38+
only-new-issues: true
39+
40+
security:
41+
name: Security
42+
runs-on: ubuntu-20.04
43+
steps:
44+
- name: Check out code into the Go module directory
45+
uses: actions/checkout@v2
46+
47+
- name: Initialize CodeQL
48+
uses: github/codeql-action/init@v1
49+
with:
50+
languages: go
51+
52+
- name: Autobuild
53+
uses: github/codeql-action/autobuild@v1
54+
55+
- name: Perform CodeQL Analysis
56+
uses: github/codeql-action/analyze@v1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Integration tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
integration-test:
11+
name: Integration test
12+
runs-on: ubuntu-20.04
13+
steps:
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: 1.17
19+
20+
- name: Check out code into the Go module directory
21+
uses: actions/checkout@v2
22+
23+
- name: Test
24+
run: ./test/test.sh

builder/.github/workflows/release.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
goreleaser:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
-
13+
name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
-
18+
name: Set up Go
19+
uses: actions/setup-go@v2
20+
with:
21+
go-version: 1.17
22+
-
23+
name: Run GoReleaser
24+
uses: goreleaser/goreleaser-action@v2
25+
with:
26+
version: latest
27+
args: release --rm-dist
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

builder/.gitignore

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/go,vscode
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=go,vscode
4+
5+
### Go ###
6+
# Binaries for programs and plugins
7+
*.exe
8+
*.exe~
9+
*.dll
10+
*.so
11+
*.dylib
12+
13+
# Test binary, built with `go test -c`
14+
*.test
15+
16+
# Output of the go coverage tool, specifically when used with LiteIDE
17+
*.out
18+
19+
# Dependency directories (remove the comment below to include it)
20+
# vendor/
21+
22+
### Go Patch ###
23+
/vendor/
24+
/Godeps/
25+
26+
### vscode ###
27+
.vscode/*
28+
!.vscode/settings.json
29+
!.vscode/tasks.json
30+
!.vscode/launch.json
31+
!.vscode/extensions.json
32+
*.code-workspace
33+
34+
### goland ###
35+
.idea
36+
37+
# End of https://www.toptal.com/developers/gitignore/api/go,vscode
38+
39+
/dist/
40+
opentelemetry-collector-builder

builder/.golangci.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# all available settings of specific linters
2+
linters-settings:
3+
goheader:
4+
template-path: header.txt
5+
goimports:
6+
local-prefixes: github.com/open-telemetry/opentelemetry-collector-builder
7+
maligned:
8+
suggest-new: true
9+
misspell:
10+
locale: US
11+
12+
linters:
13+
enable:
14+
- goheader
15+
- goimports
16+
- maligned
17+
- misspell
18+
- gosec

builder/.goreleaser.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
before:
2+
hooks:
3+
- go mod download
4+
builds:
5+
- flags:
6+
- -trimpath
7+
ldflags:
8+
- -s -w -X github.com/open-telemetry/opentelemetry-collector-builder/cmd.version={{.Version}} -X github.com/open-telemetry/opentelemetry-collector-builder/cmd.date={{.Date}}
9+
env:
10+
- CGO_ENABLED=0
11+
goos:
12+
- linux
13+
- windows
14+
- darwin
15+
goarch:
16+
- amd64
17+
- arm
18+
- arm64
19+
goarm:
20+
- 6
21+
- 7
22+
archives:
23+
- format: binary
24+
checksum:
25+
name_template: "checksums.txt"
26+
snapshot:
27+
name_template: "{{ .Tag }}-next"
28+
changelog:
29+
sort: asc
30+
filters:
31+
exclude:
32+
- "^docs:"
33+
- "^test:"

0 commit comments

Comments
 (0)