2016-07-02 13:18:53 +00:00
# Contributing
Your contributions are always welcome!
## Process
### Environment
Before starting make sure you have:
2016-07-02 13:29:43 +00:00
- git
- bash
2017-09-24 14:03:05 +00:00
- bundler
- docker
- gawk
2016-07-02 13:29:43 +00:00
- gnupg (or gnupg2)
2017-09-24 14:03:05 +00:00
- ruby
- sha256sum
2016-07-02 13:29:43 +00:00
- [shellcheck ](https://github.com/koalaman/shellcheck )
2017-09-24 14:03:05 +00:00
- test-kitchen
2016-07-02 13:18:53 +00:00
Only required if dealing with manuals, `gh-pages` or releases:
2016-07-02 13:29:43 +00:00
- ruby, ruby-dev
2016-07-02 13:18:53 +00:00
### Getting started
2016-07-02 13:29:43 +00:00
1. Create your own or pick an opened issue from the [tracker][tracker]. Take a look at the [`help-wanted` tag][help-wanted]
2016-07-02 13:18:53 +00:00
2. Fork and clone your repository: `git clone https://github.com/${YOUR_NAME}/git-secret.git`
2017-09-24 14:03:05 +00:00
3. Make sure that everything works on the current platform by running `make test`
4. [Run local CI tests ](#running-local-ci-tests ) to verify functionality on supported platforms `bundle exec kitchen verify --test-base-path="$PWD/.ci-tests/integration"` .
2016-07-02 13:18:53 +00:00
### Development Process
1. Firstly, you will need to setup development hooks with `make install-hooks`
2. Make changes to the files that need to be changed
3. When making changes to any files inside `src/` you will need to rebuild the binary `git-secret` with `make clean && make build` command
Version 0.2.2 pre-release
There are a lot of changes, multiple things were refactored: tests,
some commands, building and meta.
Several critical bugs fixed.
Changes:
1. Fixed #74, when `_user_required` was not working after reimporting keys
2. Closes #73, now it is possible to provide multiple emails to the `killperson` command
3. Closes #72, now it is possible to provide multiple emails to the `tell` command
4. Closes #71, now every doc in this project refer to `git-secret.io` instead of old `gh-pages` website
5. Closes #70, now installation section is removed from main `man` file
6. Closes #69, now "See also" section in the `man`s are clickable
7. Closes #61, added "Manual" section to the manuals
8. Refs #38, added `centos` Dockerfile, but `ci` testing is still failing
9. Refs #52, tests are refactored. Added `clean` command tests, removed a lot of hardcoded things, moved tests execution from `./temp` folder to `/tmp`, added a lot of new check in old tests, and some new test cases
10. Refactored `hide` and `clean` commands to be shorter
11. `shellcheck` is now supported with `make lint`
Additional features are not comming to 0.2.2 after this commit.
2017-02-26 13:38:46 +00:00
4. Run [`shellcheck`][shellcheck] against all your changes with `make lint`
2016-07-10 11:28:48 +00:00
5. Now, add all your files to the commit with `git add --all` and commit changes with `git commit` , make sure you write a good message, which will explain your work
6. When running `git commit` the tests will run automatically, your commit will be canceled if they fail
Version 0.2.2 pre-release
There are a lot of changes, multiple things were refactored: tests,
some commands, building and meta.
Several critical bugs fixed.
Changes:
1. Fixed #74, when `_user_required` was not working after reimporting keys
2. Closes #73, now it is possible to provide multiple emails to the `killperson` command
3. Closes #72, now it is possible to provide multiple emails to the `tell` command
4. Closes #71, now every doc in this project refer to `git-secret.io` instead of old `gh-pages` website
5. Closes #70, now installation section is removed from main `man` file
6. Closes #69, now "See also" section in the `man`s are clickable
7. Closes #61, added "Manual" section to the manuals
8. Refs #38, added `centos` Dockerfile, but `ci` testing is still failing
9. Refs #52, tests are refactored. Added `clean` command tests, removed a lot of hardcoded things, moved tests execution from `./temp` folder to `/tmp`, added a lot of new check in old tests, and some new test cases
10. Refactored `hide` and `clean` commands to be shorter
11. `shellcheck` is now supported with `make lint`
Additional features are not comming to 0.2.2 after this commit.
2017-02-26 13:38:46 +00:00
7. Push to your repository, make a pull-request against `develop` branch. Please, make sure you have **one** commit per pull-request, it will be merge into one anyways
2016-07-02 13:18:53 +00:00
### Branches
2017-03-27 18:51:33 +00:00
We have three long-live branches: `master` , `develop` and `gh-pages` for static site.
2016-07-02 13:18:53 +00:00
It basically looks like that:
2017-03-27 18:51:33 +00:00
> `your-branch` -> `develop` -> `master`
2016-07-02 13:18:53 +00:00
2017-03-27 18:51:33 +00:00
- `master` branch is protected. So only fully tested code goes there. It is also used to create a new `git` tag and a `github` release
2016-07-02 13:29:43 +00:00
- `develop` is where the development is done and the branch you should send your pull-requests to
2016-07-02 13:18:53 +00:00
### Continuous integration
2017-09-24 14:03:05 +00:00
Local CI is done with the help [`test-kitchen` ](http://kitchen.ci/ ). `test-kitchen` handles multiple test-suites on various platforms.
`bundle exec kitchen list` will output the list of test suites to be run aginst supported platforms.
Cloud CI is done with the help of `travis` . `travis` handles multiple environments:
2016-07-02 13:18:53 +00:00
2016-07-10 11:28:48 +00:00
- `Docker` -based jobs or so-called 'integration tests', these tests create a local release, install it with the package manager and then run unit-tests and system checks
- `OSX` jobs, which handle basic unit-tests on `OSX`
- Native `travis` jobs, which handle basic unit-tests and stylechecks
2016-07-02 13:18:53 +00:00
2017-09-24 14:03:05 +00:00
### Running local ci-tests
1. Install requied gems with `bundle install` .
2. Run ci-tests with `bundle exec kitchen verify --test-base-path="$PWD/.ci-tests/integration"`
2016-07-02 13:18:53 +00:00
### Release process
Version 0.2.2 pre-release
There are a lot of changes, multiple things were refactored: tests,
some commands, building and meta.
Several critical bugs fixed.
Changes:
1. Fixed #74, when `_user_required` was not working after reimporting keys
2. Closes #73, now it is possible to provide multiple emails to the `killperson` command
3. Closes #72, now it is possible to provide multiple emails to the `tell` command
4. Closes #71, now every doc in this project refer to `git-secret.io` instead of old `gh-pages` website
5. Closes #70, now installation section is removed from main `man` file
6. Closes #69, now "See also" section in the `man`s are clickable
7. Closes #61, added "Manual" section to the manuals
8. Refs #38, added `centos` Dockerfile, but `ci` testing is still failing
9. Refs #52, tests are refactored. Added `clean` command tests, removed a lot of hardcoded things, moved tests execution from `./temp` folder to `/tmp`, added a lot of new check in old tests, and some new test cases
10. Refactored `hide` and `clean` commands to be shorter
11. `shellcheck` is now supported with `make lint`
Additional features are not comming to 0.2.2 after this commit.
2017-02-26 13:38:46 +00:00
The release process is defined in the `git` -hooks and `.travis.yml` .
2016-07-02 13:18:53 +00:00
2017-03-27 18:51:33 +00:00
When creating a commit inside the `master` branch (it is usually a documentation and changelog update with the version bump inside `src/version.sh` ) it will trigger two main events.
2016-07-02 13:18:53 +00:00
Firstly, new manuals will be created and added to the current commit with `make build-man` on `pre-commit` hook.
2016-07-10 11:28:48 +00:00
Secondly, after the commit is successfully created it will also trigger `make build-gh-pages` target on `post-commit` hook, which will push new manuals to the [git-secret site][git-secret-site]. And the new `git` tag will be automatically created if the version is changed:
2016-07-02 13:18:53 +00:00
```bash
if [[ "$NEWEST_TAG" != "v${SCRIPT_VERSION}" ]]; then
git tag -a "v${SCRIPT_VERSION}" -m "version $SCRIPT_VERSION"
fi
```
#### Travis releases
2016-07-10 11:28:48 +00:00
When creating a commit inside `master` branch, `travis` on successful build will publish new `deb` and `rpm` packages to [`bintray`][bintray].
2016-07-02 13:18:53 +00:00
2016-07-10 11:28:48 +00:00
If you wish to override a previous release (*be careful*) you will need to add `"override": 1` into `matrixParams` , see `deb-deploy.sh` and `rpm-deploy.sh`
2016-07-02 13:18:53 +00:00
#### Manual releases
Releases to `brew` are made manually.
#### Dockerhub releases
2016-07-10 11:28:48 +00:00
[`Dockerhub`][Dockerhub] contains `Docker` images with different OS'es used for testing. It is updated via a `github` webhook on commit into `master` .
2016-07-02 13:29:43 +00:00
[tracker]: https://github.com/sobolevn/git-secret/issues
[help-wanted]: https://github.com/sobolevn/git-secret/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22
2016-07-10 11:28:48 +00:00
[shellcheck]: https://github.com/koalaman/shellcheck
Version 0.2.2 pre-release
There are a lot of changes, multiple things were refactored: tests,
some commands, building and meta.
Several critical bugs fixed.
Changes:
1. Fixed #74, when `_user_required` was not working after reimporting keys
2. Closes #73, now it is possible to provide multiple emails to the `killperson` command
3. Closes #72, now it is possible to provide multiple emails to the `tell` command
4. Closes #71, now every doc in this project refer to `git-secret.io` instead of old `gh-pages` website
5. Closes #70, now installation section is removed from main `man` file
6. Closes #69, now "See also" section in the `man`s are clickable
7. Closes #61, added "Manual" section to the manuals
8. Refs #38, added `centos` Dockerfile, but `ci` testing is still failing
9. Refs #52, tests are refactored. Added `clean` command tests, removed a lot of hardcoded things, moved tests execution from `./temp` folder to `/tmp`, added a lot of new check in old tests, and some new test cases
10. Refactored `hide` and `clean` commands to be shorter
11. `shellcheck` is now supported with `make lint`
Additional features are not comming to 0.2.2 after this commit.
2017-02-26 13:38:46 +00:00
[git-secret-site]: http://git-secret.io
2016-07-10 11:28:48 +00:00
[bintray]: https://bintray.com/sobolevn
[Dockerhub]: https://hub.docker.com/r/sobolevn/git-secret/