Skip to content

Commit

Permalink
add(core): Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
babarot committed Apr 6, 2018
0 parents commit 810505e
Show file tree
Hide file tree
Showing 52 changed files with 4,156 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

This file is automatically generated by [git-chglog](https://github.com/git-chglog/git-chglog). Don't edit by hand.

{{range .Versions}}
<a name="{{.Tag.Name}}"></a>
## {{if .Tag.Previous}}[{{.Tag.Name}}]({{$.Info.RepositoryURL}}/compare/{{.Tag.Previous.Name}}...{{.Tag.Name}}){{else}}{{.Tag.Name}}{{end}} ({{datetime "2006-01-02" .Tag.Date}})
{{range .CommitGroups}}
### {{.Title}}
{{range .Commits}}
* {{if ne .Scope ""}}**{{.Scope}}:** {{end}}{{.Subject}}{{end}}
{{end}}{{if .RevertCommits}}
### Reverts
{{range .RevertCommits}}
* {{.Revert.Header}}{{end}}
{{end}}{{if .MergeCommits}}
### Pull Requests
{{range .MergeCommits}}
* {{.Header}}{{end}}
{{end}}{{range .NoteGroups}}
### {{.Title}}
{{range .Notes}}
{{.Body}}
{{end}}
{{end}}
{{end}}
32 changes: 32 additions & 0 deletions .chglog/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/mercari/tfnotify
options:
commits:
filters:
Type:
- add
- change
- deprecate
- remove
- fix
- security
commit_groups:
title_maps:
add: Added
change: Changed
deprecate: Deprecated
remove: Removed
fix: Fixed
security: Security
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
pattern_maps:
- Type
- Scope
- Subject
notes:
keywords:
- BREAKING CHANGE
53 changes: 53 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: 2

defaults: &defaults
working_directory: /go/src/github.com/mercari/tfnotify

jobs:
build:
<<: *defaults
docker:
- image: golang:1.10-stretch
steps:
- checkout
- run:
name: Install dpendency tools and vendor
command: |
go get -u github.com/golang/dep/cmd/dep
dep ensure
- run:
name: Run test
command: |
make test
- run:
name: Run coverage
command: |
make coverage
bash <(curl -s https://codecov.io/bash)
lint:
<<: *defaults
docker:
- image: golang:1.10-stretch
steps:
- checkout
- run:
name: Install dpendency tools and vendor
command: |
make dep
dep ensure
- run:
name: Run lint
command: |
make reviewdog
workflows:
version: 2
build-workflow:
jobs:
- build
- lint:
filters:
branches:
ignore:
- master
9 changes: 9 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
coverage:
precision: 2
round: down
range: 70...90

ignore:
- "main.go"
- "notifier/github/github.go"
- "notifier/slack/slack.go"
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# https://help.github.com/articles/about-codeowners/
* @b4b4r07
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## WHAT

(Write the change being made with this pull request)

## WHY

(Write the motivation why you submit this pull request)
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Created by https://www.gitignore.io/api/go

### Go ###
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out


# End of https://www.gitignore.io/api/go

tfnotify
vendor
dist
3 changes: 3 additions & 0 deletions .reviewdog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
runner:
golint:
cmd: golint $(go list ./...)
99 changes: 99 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"

[prune]
go-tests = true
unused-packages = true
non-go = true

[[constraint]]
branch = "master"
name = "golang.org/x/oauth2"

[[constraint]]
name = "gopkg.in/yaml.v2"
version = "2.1.1"

[[constraint]]
name = "github.com/urfave/cli"
version = "1.20.0"
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2018 Mercari, Inc.

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43 changes: 43 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
PACKAGES := $(shell go list ./...)
COMMIT = $$(git describe --tags --always)
DATE = $$(date -u '+%Y-%m-%d_%H:%M:%S')
BUILD_LDFLAGS = -X $(PKG).commit=$(COMMIT) -X $(PKG).date=$(DATE)
RELEASE_BUILD_LDFLAGS = -s -w $(BUILD_LDFLAGS)

.PHONY: all
all: test

.PHONY: build
build:
go build

.PHONY: crossbuild
crossbuild:
$(eval version = $(shell gobump show -r))
goxz -pv=v$(version) -os=linux,darwin -arch=386,amd64 -build-ldflags="$(RELEASE_BUILD_LDFLAGS)" \
-d=./dist/v$(version)

.PHONY: test
test:
go test -v -parallel=4 ./...

.PHONY: dep
dep: devel-deps
dep ensure -v

.PHONY: reviewdog
reviewdog: devel-deps
reviewdog -ci="circle-ci"

.PHONY: coverage
coverage: devel-deps
goverage -v -covermode=atomic -coverprofile=coverage.txt $(PACKAGES)

.PHONY: release
release: devel-deps
@./misc/bump-and-chglog.sh
@./misc/upload-artifacts.sh

.PHONY: devel-deps
devel-deps:
@./misc/install-devel-deps.sh
Loading

0 comments on commit 810505e

Please sign in to comment.