Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mai committed Jan 12, 2021
0 parents commit f705429
Show file tree
Hide file tree
Showing 21 changed files with 750 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coverage:
range: 50..80
round: down
precision: 2

ignore:
- "*_test.go"
- "vendor"

fixes:
- "github.com/xmidt-org/__PROJECT__/::"
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vendor
__PROJECT__
conf
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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
coverage*
report.json

# Ignore the vendor structure
*vendor/

# Ignore the various build artifacts
.ignore

# Vim
*.swp
31 changes: 31 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
linters-settings:
misspell:
locale: US

linters:
enable:
- bodyclose
- dupl
- errorlint
- funlen
- goconst
- gosec
- misspell
- unconvert
- prealloc
disable:
- errcheck
- ineffassign

issues:
exclude-rules:
- path: _test.go
linters:
- dupl
- funlen

linters-settings:
errorlint:
# Report non-wrapping error creation using fmt.Errorf
errorf: false
34 changes: 34 additions & 0 deletions .sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Reference:
# https://github.com/SonarSource/sonarcloud_example_go-sqscanner-travis/blob/master/sonar-project.properties


# =====================================================
# Standard properties
# =====================================================

sonar.organization=xmidt-org
sonar.projectKey=xmidt-org___PROJECT__
sonar.projectName=__PROJECT__

sonar.sources=.
sonar.exclusions=**/*_test.go,**/vendor/**

sonar.tests=.
sonar.test.inclusions=**/*_test.go
sonar.test.exclusions=**/vendor/**

# =====================================================
# Meta-data for the project
# =====================================================

sonar.links.homepage=https://github.com/xmidt-org/__PROJECT__
sonar.links.ci=https://github.com/xmidt-org/__PROJECT__/actions
sonar.links.scm=https://github.com/xmidt-org/__PROJECT__
sonar.links.issue=https://github.com/xmidt-org/__PROJECT__/issues

# =====================================================
# Properties specific to Go
# =====================================================

sonar.go.tests.reportPaths=report.json
sonar.go.coverage.reportPaths=coverage.txt
12 changes: 12 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scanSettings": {
"baseBranches": []
},
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "failure",
"displayMode": "diff"
},
"issueSettings": {
"minSeverityLevel": "LOW"
}
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 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).

## [Unreleased]

## [v0.0.1]
- Initial creation

[Unreleased]: https://github.com/xmidt-org/__PROJECT__/compare/v0.0.1..HEAD
[v0.0.1]: https://github.com/xmidt-org/__PROJECT__/compare/0.0.0...v0.0.1
66 changes: 66 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Contribution Guidelines
=======================

We love to see contributions to the project and have tried to make it easy to
do so. If you would like to contribute code to this project you can do so
through GitHub by [forking the repository and sending a pull request](http://gun.io/blog/how-to-github-fork-branch-and-pull-request/).

Before Comcast merges your code into the project you must sign the
[Comcast Contributor License Agreement (CLA)](https://gist.github.com/ComcastOSS/a7b8933dd8e368535378cda25c92d19a).

If you haven't previously signed a Comcast CLA, you'll automatically be asked
to when you open a pull request. Alternatively, we can e-mail you a PDF that
you can sign and scan back to us. Please send us an e-mail or create a new
GitHub issue to request a PDF version of the CLA.

If you have a trivial fix or improvement, please create a pull request and
request a review from a [maintainer](MAINTAINERS.md) of this repository.

If you plan to do something more involved, that involves a new feature or
changing functionality, please first create an [issue](#issues) so a discussion of
your idea can happen, avoiding unnecessary work and clarifying implementation.

A relevant coding style guideline is the [Go Code Review Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments).

Documentation
-------------

If you contribute anything that changes the behavior of the application,
document it in the follow places as applicable:
* the code itself, through clear comments and unit tests
* [README](README.md)

This includes new features, additional variants of behavior, and breaking
changes.

Testing
-------

Tests are written using golang's standard testing tools, and are run prior to
the PR being accepted.

Issues
------

For creating an issue:
* **Bugs:** please be as thorough as possible, with steps to recreate the issue
and any other relevant information.
* **Feature Requests:** please include functionality and use cases. If this is
an extension of a current feature, please include whether or not this would
be a breaking change or how to extend the feature with backwards
compatibility.
* **Security Vulnerability:** please report it at
https://my.xfinity.com/vulnerabilityreport and contact the [maintainers](MAINTAINERS.md).

If you wish to work on an issue, please assign it to yourself. If you have any
questions regarding implementation, feel free to ask clarifying questions on
the issue itself.

Pull Requests
-------------

* should be narrowly focused with no more than 3 or 4 logical commits
* when possible, address no more than one issue
* should be reviewable in the GitHub code review tool
* should be linked to any issues it relates to (i.e. issue number after (#) in commit messages or pull request message)
* should conform to idiomatic golang code formatting
42 changes: 42 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM docker.io/library/golang:1.15-alpine as builder

MAINTAINER Jack Murdock <[email protected]>

WORKDIR /src

ARG VERSION
ARG GITCOMMIT
ARG BUILDTIME


RUN apk add --no-cache --no-progress \
ca-certificates \
make \
git \
openssh \
gcc \
libc-dev \
upx

RUN go get github.com/geofffranks/spruce/cmd/spruce && chmod +x /go/bin/spruce
COPY . .
RUN make test release

FROM alpine:3.12.1

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /src/__PROJECT__ /src/__PROJECT__.yaml /src/deploy/packaging/entrypoint.sh /go/bin/spruce /src/Dockerfile /src/NOTICE /src/LICENSE /src/CHANGELOG.md /
COPY --from=builder /src/deploy/packaging/__PROJECT__.yaml /tmp/__PROJECT__.yaml

RUN mkdir /etc/__PROJECT__/ && touch /etc/__PROJECT__/__PROJECT__.yaml && chmod 666 /etc/__PROJECT__/__PROJECT__.yaml

USER nobody

ENTRYPOINT ["/entrypoint.sh"]

EXPOSE 6600
EXPOSE 6601
EXPOSE 6602
EXPOSE 6603

CMD ["/__PROJECT__"]
Loading

0 comments on commit f705429

Please sign in to comment.