Skip to content

Commit 304e9a5

Browse files
committed
add initial core content
1 parent 674ba4f commit 304e9a5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+6427
-1
lines changed

.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SLACK_TOKEN=
2+
SLACK_WORKSPACE_TOKEN=

.github/CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# These owners will be the default owners for everything in the repo.
2+
* @wass3r @sjqnn @pa3ng @JordanSussman

.github/CODE_OF_CONDUCT.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at
59+
60+
complaints will be reviewed and investigated and will result in a response that
61+
is deemed necessary and appropriate to the circumstances. The project team is
62+
obligated to maintain confidentiality with regard to the reporter of an incident.
63+
Further details of specific enforcement policies may be posted separately.
64+
65+
Project maintainers who do not follow or enforce the Code of Conduct in good
66+
faith may face temporary or permanent repercussions as determined by other
67+
members of the project's leadership.
68+
69+
## Attribution
70+
71+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
72+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
73+
74+
[homepage]: https://www.contributor-covenant.org

.github/CONTRIBUTING.md

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
## Contributing
2+
3+
To ensure that all developers follow the same guidelines for development, we have laid out the following procedure.
4+
5+
### Prerequisites
6+
7+
- [Golang](https://golang.org/dl/) - the source code is written in Go.
8+
- [dep](https://github.com/golang/dep) - our Go dependency management tool.
9+
- Slack API token - obtain a Slack API token for development by creating a bot integration.
10+
11+
### Development Process
12+
13+
- Clone this repository to your Go workspace:
14+
15+
```sh
16+
# Make sure your go paths are set if they aren't already
17+
export GOPATH=$HOME/go
18+
export PATH=$PATH:$GOPATH/bin
19+
20+
# Clone the project
21+
git clone [email protected]:target/flottbot.git $GOPATH/src/github.com/target/flottbot
22+
```
23+
24+
- Build the project dependencies using [dep](https://github.com/golang/dep):
25+
26+
```sh
27+
# Change into the project directory
28+
cd $GOPATH/src/github.com/target/flottbot
29+
30+
# Run dep
31+
dep ensure
32+
```
33+
34+
- Write your code and ensure all tests pass.
35+
36+
```sh
37+
# Checkout a branch for your work
38+
git checkout -b name_of_your_branch
39+
40+
# Code away!
41+
```
42+
43+
- Build the project and run locally:
44+
45+
```sh
46+
# Export your Slack API token (the token below is redacted)
47+
export SLACK_TOKEN=xoxb-xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx
48+
49+
# Build the binary and run flottbot
50+
go build . && ./flottbot
51+
```
52+
53+
- If you followed the above steps correctly, you should see output similar to this:
54+
55+
```sh
56+
DEBU[0000] Registering bot...
57+
DEBU[0000] Bot 'flottbot' registered!
58+
DEBU[0000] Searching for rules directory...
59+
DEBU[0000] Fetching all YAML files...
60+
DEBU[0000] Reading and parsing YAML files...
61+
DEBU[0000] Successfully created rules
62+
DEBU[0000] Registering flottbot to Slack...
63+
DEBU[0000] Found channels!
64+
DEBU[0000] Registering CLI support for flottbot...
65+
Enter CLI mode: hit <Enter>. <Ctrl-C> to exit.
66+
DEBU[0001] Connection established!
67+
```
68+
69+
- You should now see your bot online in your Slack Workspace where you can manually test your changes.
70+
71+
- Satisfied with your contribution? Record your changes in the [changelog](https://github.com/target/flottbot/blob/master/CHANGELOG.md).
72+
73+
- Submit a PR for your changes.
74+
75+
- After the Travis build passes and you have an approved review, we will merge your PR.
76+
77+
- We will tag a release for flottbot when the desired functionality is present and stable.
78+
- Production images of your changes will be published to Docker Hub and new binaries will be built and made available via Github Releases

.github/ISSUE_TEMPLATE.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Report
2+
3+
## What did you do?
4+
5+
ℹ Please replace this with what you did.
6+
7+
## What did you expect to happen?
8+
9+
ℹ Please replace this with what you expected to happen.
10+
e.g. Running your flottbot without it crashing.
11+
12+
## What happened instead?
13+
14+
ℹ Please replace this with of what happened instead.
15+
e.g. 💥
16+
17+
## Your Environment
18+
19+
- Run `flottbot --version` and paste the output here
20+
- What OS are you running on?
21+
- Your `bot.yml` (remove any sensitive information!)
22+
- Maybe the contents of the `.yml` for the rule you're trying to run, if applicable (remove any sensitive information!)
23+
24+
```yaml
25+
# please paste .bot.yml here (remove any sensitive information!)
26+
```
27+
28+
```yaml
29+
# please paste contents of your rule, if applicable (remove any sensitive information!)
30+
```

.github/PULL_REQUEST_TEMPLATE.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
### ❤ THANKS FOR HELPING OUT :D
2+
3+
## Proposed change
4+
5+
Describe your change and communicate why we should accept the pull request. Links to issues are helpful too, if applicable.
6+
7+
## Types of changes
8+
9+
What types of changes is this pull request introducing to flottbot? _Put an `x` in the boxes that apply_
10+
11+
- [ ] Bugfix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
15+
## Checklist
16+
17+
You can fill this out after creating your PR. _Put an `x` in the boxes that apply_
18+
19+
- [ ] I have added tests that prove my fix is effective or that my feature works
20+
- [ ] I have added necessary documentation (if appropriate)

.gitignore

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
# Created by https://www.gitignore.io/api/go,osx,visualstudiocode
3+
4+
### Go ###
5+
# Binaries for programs and plugins
6+
*.exe
7+
*.dll
8+
*.so
9+
*.dylib
10+
11+
# Test binary, build with `go test -c`
12+
*.test
13+
14+
# Output of the go coverage tool, specifically when used with LiteIDE
15+
*.out
16+
17+
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
18+
.glide/
19+
20+
### OSX ###
21+
*.DS_Store
22+
.AppleDouble
23+
.LSOverride
24+
25+
# Icon must end with two \r
26+
Icon
27+
28+
# Thumbnails
29+
._*
30+
31+
# Files that might appear in the root of a volume
32+
.DocumentRevisions-V100
33+
.fseventsd
34+
.Spotlight-V100
35+
.TemporaryItems
36+
.Trashes
37+
.VolumeIcon.icns
38+
.com.apple.timemachine.donotpresent
39+
40+
# Directories potentially created on remote AFP share
41+
.AppleDB
42+
.AppleDesktop
43+
Network Trash Folder
44+
Temporary Items
45+
.apdisk
46+
47+
### VisualStudioCode ###
48+
.vscode/*
49+
!.vscode/settings.json
50+
!.vscode/tasks.json
51+
!.vscode/launch.json
52+
!.vscode/extensions.json
53+
.history
54+
55+
# End of https://www.gitignore.io/api/go,osx,visualstudiocode
56+
57+
.env
58+
debug
59+
flottbot
60+
61+
### Git ###
62+
vendor

.travis.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
language: go
2+
sudo: false
3+
4+
go:
5+
- "1.9"
6+
7+
before_script:
8+
- go get github.com/golang/dep/cmd/dep
9+
- go get github.com/mitchellh/gox
10+
- go get github.com/mattn/goveralls
11+
12+
script:
13+
- dep ensure
14+
- go vet $(go list ./... | grep -v /vendor/)
15+
- go test -cover -coverprofile coverage.out $(go list ./... | grep -v /vendor/)
16+
- gox -ldflags "-X github.com/target/flottbot/version.Version=${TRAVIS_TAG} -X github.com/target/flottbot/version.GitHash=${TRAVIS_COMMIT}" -os="linux darwin windows" -arch="amd64" -verbose ./...
17+
- cd $TRAVIS_BUILD_DIR
18+
- $GOPATH/bin/goveralls -service=travis-ci
19+
20+
before_deploy:
21+
- cd $TRAVIS_BUILD_DIR
22+
- ./tar-release.sh
23+
24+
deploy:
25+
provider: releases
26+
api_key:
27+
secure:
28+
file_glob: true
29+
file: "*.tgz"
30+
skip_cleanup: true
31+
on:
32+
tags: true

.vscode/launch.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Launch",
9+
"type": "go",
10+
"request": "launch",
11+
"mode": "exec",
12+
"remotePath": "",
13+
"port": 2345,
14+
"host": "127.0.0.1",
15+
"program": "${workspaceRoot}/debug",
16+
"preLaunchTask": "build-debug",
17+
"envFile": "${workspaceRoot}/.env",
18+
"args": [],
19+
"showLog": true
20+
}
21+
]
22+
}

.vscode/settings.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"cSpell.words": [
3+
"bfoo",
4+
"capp",
5+
"curr",
6+
"dev",
7+
"dm'ed",
8+
"dockerfiles",
9+
"err",
10+
"mohae",
11+
"outter",
12+
"path",
13+
"rslt",
14+
"subv",
15+
"templating",
16+
"ugroups",
17+
"unsubstituted",
18+
"url",
19+
"usergroups"
20+
]
21+
}

0 commit comments

Comments
 (0)