-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add support for Docker builds - add support for build versions - add support for CI/CD builds
- Loading branch information
1 parent
47a3488
commit 5e5e5e6
Showing
10 changed files
with
572 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Go | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
name: Test on Go ${{ matrix.go-version }} and ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
go-version: [1.13.x, 1.14.x] | ||
os: [ubuntu-latest] | ||
steps: | ||
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }} | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: Build on ${{ matrix.os }} | ||
env: | ||
GO111MODULE: on | ||
run: | | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.21.0 | ||
$(go env GOPATH)/bin/golangci-lint run --timeout=5m --config ./.golangci.yml | ||
go test -v -race ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
linters-settings: | ||
misspell: | ||
locale: US | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- typecheck | ||
- goimports | ||
- misspell | ||
- govet | ||
- golint | ||
- ineffassign | ||
- gosimple | ||
- deadcode | ||
- structcheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,72 @@ | ||
# This is an example goreleaser.yaml file with some sane defaults. | ||
# Make sure to check the documentation at http://goreleaser.com | ||
project_name: sidekick | ||
|
||
before: | ||
hooks: | ||
# you may remove this if you don't use vgo | ||
- go mod tidy | ||
# you may remove this if you don't need go generate | ||
- go generate ./... | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
- | ||
goos: | ||
- freebsd | ||
- windows | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
env: | ||
- CGO_ENABLED=0 | ||
ldflags: | ||
- -s -w -X github.com/minio/sidekick.ReleaseTag={{.Tag}} -X github.com/minio/sidekick.CommitID={{.FullCommit}} -X github.com/minio/sidekick.Version={{.Version}} -X github.com/minio/sidekick.ShortCommitID={{.ShortCommit}} -X github.com/minio/sidekick.ReleaseTime={{.Date}} | ||
archives: | ||
- replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
386: i386 | ||
amd64: x86_64 | ||
- | ||
replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
freebsd: FreeBSD | ||
amd64: x86_64 | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
files: | ||
- README.md | ||
- LICENSE | ||
- sidekick_logo.png | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
name_template: 'snapshot-{{ time "2006-01-02" }}' | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
nfpms: | ||
- | ||
vendor: MinIO, Inc. | ||
homepage: https://github.com/minio/sidekick | ||
maintainer: MinIO <[email protected]> | ||
description: sidekick is a load-balancer run as a sidecar | ||
license: GNU Affero General Public License v3.0 | ||
formats: | ||
- deb | ||
- rpm | ||
replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
freebsd: FreeBSD | ||
amd64: x86_64 | ||
dockers: | ||
- | ||
# GOOS of the built binary that should be used. | ||
goos: linux | ||
# GOARCH of the built binary that should be used. | ||
goarch: amd64 | ||
dockerfile: Dockerfile.release | ||
image_templates: | ||
- "minio/sidekick:{{ .Tag }}" | ||
- "minio/sidekick:latest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM golang:1.13.8 | ||
|
||
ADD go.mod /go/src/github.com/minio/sidekick/go.mod | ||
ADD go.sum /go/src/github.com/minio/sidekick/go.sum | ||
WORKDIR /go/src/github.com/minio/sidekick/ | ||
# Get dependencies - will also be cached if we won't change mod/sum | ||
RUN go mod download | ||
|
||
ADD . /go/src/github.com/minio/sidekick/ | ||
WORKDIR /go/src/github.com/minio/sidekick/ | ||
|
||
ENV CGO_ENABLED=0 | ||
|
||
RUN go build -ldflags '-w -s' -a -o sidekick . | ||
|
||
FROM scratch | ||
MAINTAINER MinIO Development "[email protected]" | ||
EXPOSE 8080 | ||
|
||
COPY --from=0 /go/src/github.com/minio/sidekick/sidekick /sidekick | ||
|
||
ENTRYPOINT ["/sidekick"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM scratch | ||
MAINTAINER MinIO Development "[email protected]" | ||
EXPOSE 8080 | ||
COPY sidekick /sidekick | ||
ENTRYPOINT ["/sidekick"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2020 MinIO, Inc. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>.package main | ||
|
||
package main | ||
|
||
var ( | ||
// Version - the version being released (v prefix stripped) | ||
Version = "(dev)" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.