From 88b73cb18669ef4127d810cc788766edcbfcb87e Mon Sep 17 00:00:00 2001 From: Andrew Suderman Date: Tue, 23 Jun 2020 13:30:02 -0600 Subject: [PATCH] Circle, COC, CONTRIB --- .circleci/build.config | 10 ++++++ .circleci/config.yml | 63 +++++++++++++++++++++++++++++++++++ .gitignore | 3 ++ CODEOWNERS | 1 + CODE_OF_CONDUCT.md | 74 ++++++++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 50 ++++++++++++++++++++++++++++ 6 files changed, 201 insertions(+) create mode 100644 .circleci/build.config create mode 100644 .circleci/config.yml create mode 100644 CODEOWNERS create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md diff --git a/.circleci/build.config b/.circleci/build.config new file mode 100644 index 0000000..e78c321 --- /dev/null +++ b/.circleci/build.config @@ -0,0 +1,10 @@ +DOCKERFILE='Dockerfile' + +EXTERNAL_REGISTRY_BASE_DOMAIN=quay.io +REPOSITORY_NAME=fairwinds/pluto +DOCKERTAG=${EXTERNAL_REGISTRY_BASE_DOMAIN}/${REPOSITORY_NAME} +if [[ -n $CI_TAG ]]; then + ADDITIONAL_DOCKER_TAG_VERSIONS=() + ADDITIONAL_DOCKER_TAG_VERSIONS+=(`echo $CI_TAG | sed -e 's/\(\w\+\)\..*$/\1/'`) + ADDITIONAL_DOCKER_TAG_VERSIONS+=(`echo $CI_TAG | sed -e 's/\(\w\+\.\w\+\)\..*$/\1/'`) +fi diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..e685d24 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,63 @@ +version: 2.1 + +orbs: + rok8s-scripts: fairwinds/rok8s-scripts@11 + +executors: + golang-exec: + docker: + - image: circleci/golang:1.14-stretch + +references: + install_goreleaser: &install_goreleaser + run: + name: Install GoReleaser + command: | + curl -fsSLo goreleaser.deb https://github.com/goreleaser/goreleaser/releases/download/v0.131.1/goreleaser_amd64.deb + echo "640790dcbfa864f26de4c26c2d491f293a64525c8c6641c5bbdec7136b38977e goreleaser.deb" | sha256sum -c - + sudo dpkg -i goreleaser.deb + rm goreleaser.deb +jobs: + test: + working_directory: /go/src/github.com/fairwindsops/agones-allocator-client + + docker: + - image: circleci/golang:1.14 + environment: + GO111MODULE: "on" + steps: + - checkout + - run: go mod download && go mod verify + - run: go test -v ./... -coverprofile=coverage.txt -covermode=atomic + - run: bash <(curl -s https://codecov.io/bash) + + release_binary: + working_directory: /go/src/github.com/fairwindsops/agones-allocator-client + docker: + - image: circleci/golang:1.14 + environment: + GO111MODULE: "on" + steps: + - checkout + - run: go mod download && go mod verify + - *install_goreleaser + - run: goreleaser + +workflows: + version: 2 + test: + jobs: + - test: + filters: + branches: + only: /.*/ + tags: + ignore: /.*/ + release: + jobs: + - release_binary: + filters: + branches: + ignore: /.*/ + tags: + only: /.*/ diff --git a/.gitignore b/.gitignore index a0809af..1919459 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ /agones-allocator-client +cover-report.html +govet-report.out +coverage.txt diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..034d4b4 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @sudermanjr diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..d05f4bc --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [INSERT EMAIL ADDRESS]. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..02bb731 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,50 @@ +# Contributing + +Issues, whether bugs, tasks, or feature requests are essential for keeping agones-allocator-client great. We believe it should be as easy as possible to contribute changes that get things working in your environment. There are a few guidelines that we need contributors to follow so that we can keep on top of things. + +## Code of Conduct + +This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). Please review this document before contributing to this project. + +## Sign the CLA +Before you can contribute, you will need to sign the [Contributor License Agreement](https://cla-assistant.io/fairwindsops/agones-allocator-client). + +## Getting Started + +We label issues with the ["good first issue" tag](https://github.com/FairwindsOps/agones-allocator-client/labels/good%20first%20issue) if we believe they'll be a good starting point for new contributors. If you're interested in working on an issue, please start a conversation on that issue, and we can help answer any questions as they come up. + +## Setting Up Your Development Environment +### Prerequisites +* A properly configured Golang environment with Go 1.13 or higher + +### Installation +* Clone the project with `go get github.com/fairwindsops/agones-allocator-client` +* Change into the agones-allocator-client directory which is installed at `$GOPATH/src/github.com/fairwindsops/agones-allocator-client` +* Use `make build` to build the binary locally. +* Use `make test` to run the tests and generate a coverage report. + +## Creating a New Issue + +If you've encountered an issue that is not already reported, please create an issue that contains the following: + +- Clear description of the issue +- Steps to reproduce it +- Appropriate labels + +## Creating a Pull Request + +Each new pull request should: + +- Reference any related issues +- Add tests that show the issues have been solved +- Pass existing tests and linting +- Contain a clear indication of if they're ready for review or a work in progress +- Be up to date and/or rebased on the master branch + +## Creating a new release + +Push a new semver tag. Goreleaser will take care of the rest. + +## Pre-commit + +This repo contains a pre-commit file for use with [pre-commit](https://pre-commit.com/). Just run `pre-commit install` and you will have the hooks.