-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from anton-yurchenko/v2.0.0
v2.0.0
- Loading branch information
Showing
36 changed files
with
2,282 additions
and
425 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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
.github/ | ||
.vscode/ | ||
.idea/ | ||
.gitignore | ||
.dockerignore | ||
README.md | ||
CHANGELOG.md | ||
docs/ | ||
docs/ | ||
coverage.txt | ||
Dockerfile | ||
Makefile |
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,20 @@ | ||
# Contributing Guidelines | ||
:confetti_ball::medal_military: First of all, thank you for contributing! :medal_military::confetti_ball: | ||
|
||
## Issue: | ||
- Search for already opened [issues](https://github.com/anton-yurchenko/git-release/issues) before submitting a [new one](https://github.com/anton-yurchenko/git-release/issues/new/choose). | ||
- Provide as much information as you can, even if not requested by an Issue Template. | ||
|
||
|
||
## Pull Request: | ||
- Open [Pull Request](https://github.com/anton-yurchenko/git-release/pulls) towards **dev** branch. | ||
- Ensure [Pull Request](https://github.com/anton-yurchenko/git-release/pulls) description clearly describes the problem and solution. | ||
- Make sure all Tests are passed and there is no Code Coverage degradation. | ||
- Please follow [AngularJS Commit Message Guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines) | ||
|
||
## Other: | ||
#### Require new feature or change of an existing one? | ||
- Suggest your change via [email](email:[email protected]) or [Pull Request](https://github.com/anton-yurchenko/git-release/pulls), do not open an issue on GitHub. | ||
|
||
#### Have questions about the source code? | ||
- Feel free to contact me via [email](email:[email protected]), I'll be glad to provide any information required. |
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,4 +1,12 @@ | ||
# OS | ||
**/.DS_Store | ||
|
||
# IDE | ||
.vscode/ | ||
**/__debug_bin | ||
.idea/ | ||
**/.DS_Store | ||
vendor/ | ||
|
||
# project | ||
coverage.txt | ||
/vendor/ | ||
/release/ |
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 |
---|---|---|
@@ -1,13 +1,25 @@ | ||
FROM golang:1.13.1-alpine | ||
ARG BUILDER=golang:1.13.1-alpine | ||
ARG TESTER=golangci/golangci-lint:latest | ||
|
||
LABEL "repository"="https://github.com/anton-yurchenko/git-release" | ||
LABEL "maintainer"="Anton Yurchenko <[email protected]>" | ||
LABEL "version"="1.1.0" | ||
FROM ${TESTER} as test | ||
WORKDIR /opt/src | ||
COPY . . | ||
RUN golangci-lint run ./... | ||
RUN go test ./... -race -coverprofile=coverage.txt -covermode=atomic | ||
|
||
FROM ${BUILDER} as build | ||
WORKDIR /opt/src | ||
COPY . . | ||
RUN addgroup -g 1000 appuser &&\ | ||
adduser -D -u 1000 -G appuser appuser | ||
RUN apk add --update --no-cache alpine-sdk | ||
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o /opt/app | ||
|
||
RUN go install &&\ | ||
go build -o /opt/release &&\ | ||
rm -rf /opt/src | ||
ENTRYPOINT [ "/opt/release" ] | ||
FROM scratch | ||
LABEL "repository"="https://github.com/anton-yurchenko/git-release" | ||
LABEL "maintainer"="Anton Yurchenko <[email protected]>" | ||
LABEL "version"="2.0.0" | ||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=build /etc/passwd /etc/passwd | ||
COPY --from=build --chown=1000:0 /opt/app /app | ||
ENTRYPOINT [ "/app" ] |
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,42 @@ | ||
# global | ||
BINARY := $(notdir $(CURDIR)) | ||
GO_BIN_DIR := $(GOPATH)/bin | ||
PKGS := $(go list ./... | grep -v /vendor) | ||
|
||
# unit tests | ||
test: lint | ||
@echo "unit testing..." | ||
@go test ./... -race -coverprofile=coverage.txt -covermode=atomic | ||
|
||
# lint | ||
.PHONY: lint | ||
lint: $(GO_LINTER) | ||
@echo "vendoring..." | ||
@go mod vendor | ||
@go mod tidy | ||
@echo "linting..." | ||
@golangci-lint run ./... | ||
|
||
# initialize | ||
.PHONY: init | ||
init: | ||
@rm -f go.mod | ||
@rm -f go.sum | ||
@rm -rf ./vendor | ||
@go mod init | ||
|
||
# linter | ||
GO_LINTER := $(GO_BIN_DIR)/golangci-lint | ||
$(GO_LINTER): | ||
@echo "installing linter..." | ||
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint | ||
|
||
.PHONY: release | ||
release: test | ||
@rm -rf ./release | ||
@mkdir -p release | ||
@GOOS=linux GOARCH=amd64 go build -o ./release/app | ||
|
||
.PHONY: codecov | ||
codecov: test | ||
@go tool cover -html=coverage.txt |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,10 +1,13 @@ | ||
module git-release | ||
module github.com/anton-yurchenko/git-release | ||
|
||
go 1.12 | ||
go 1.13 | ||
|
||
require ( | ||
github.com/google/go-github v17.0.0+incompatible | ||
github.com/google/go-querystring v1.0.0 // indirect | ||
github.com/pkg/errors v0.8.1 | ||
github.com/sirupsen/logrus v1.4.2 | ||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 | ||
github.com/spf13/afero v1.2.2 | ||
github.com/stretchr/testify v1.4.0 | ||
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 | ||
) |
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.