Changes: 1. Now everything is tested inside the `docker`-containers and `OSX` images on `travis`. 2. We now have `CONTRIBUTING.md` and `LICENSE.md`. `README.md` is also changed. 3. We have a brand logo. 4. We have autodeploy to `bintray`. 5. Everything is `shellcheck`ed (except `tests/`). Closes #32 #33 #34 #35 #39
4.1 KiB
Contributing
Your contributions are always welcome!
Process
Environment
Before starting make sure you have:
- git
- bash
- gnupg (or gnupg2)
- shellcheck
Only required if dealing with manuals, gh-pages
or releases:
- ruby, ruby-dev
Getting started
- Create your own or pick an opened issue from the tracker. Take a look at the
help-wanted
tag - Fork and clone your repository:
git clone https://github.com/${YOUR_NAME}/git-secret.git
- Make sure that everything works fine by running
make test
Development Process
- Firstly, you will need to setup development hooks with
make install-hooks
- Make changes to the files that need to be changed
- When making changes to any files inside
src/
you will need to rebuild the binarygit-secret
withmake clean && make build
command - Run
shellcheck
against all your changes withfind src utils -type f -name '*.sh' -print0 | xargs -0 -I {} shellcheck {}
- Now, add all your files to the commit with
git add --all
and commit changes withgit commit
, make sure you write a good message, which will explain your work - When running
git commit
the tests will run automatically, your commit will be canceled if they fail - Push to your repository, make a pull-request against
develop
branch. Please, make sure you have one commit per pull-request
Branches
We have three long-live branches: master
, staging
and develop
(and gh-pages
for static site).
It basically looks like that:
your-branch
->develop
->staging
->master
master
branch is protected, sinceantigen
and tools like it install the app from the main branch directly. So only fully tested code goes therestaging
- this branch is used to create a newgit
tag and agithub
release, then it gets merged intomaster
develop
is where the development is done and the branch you should send your pull-requests to
Continuous integration
CI is done with the help of travis
. travis
handles multiple environments:
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 checksOSX
jobs, which handle basic unit-tests onOSX
- Native
travis
jobs, which handle basic unit-tests and stylechecks
Release process
The release process is defined in the git
-hooks and .travis.yml
.
When creating a commit inside the staging
branch (it is usually a documentation and changelog update with the version bump inside src/version.sh
) it will trigger two main events.
Firstly, new manuals will be created and added to the current commit with make build-man
on pre-commit
hook.
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. And the new git
tag will be automatically created if the version is changed:
if [[ "$NEWEST_TAG" != "v${SCRIPT_VERSION}" ]]; then
git tag -a "v${SCRIPT_VERSION}" -m "version $SCRIPT_VERSION"
fi
Then it will be merged inside master
when ready.
Travis releases
When creating a commit inside master
branch, travis
on successful build will publish new deb
and rpm
packages to bintray
.
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
Manual releases
Releases to brew
are made manually.
Dockerhub releases
Dockerhub
contains Docker
images with different OS'es used for testing. It is updated via a github
webhook on commit into master
.