mirror of https://github.com/statping/statping
Add 'changelog' Note for PR's and correct some grammar and misspellings.
parent
d7bd2cb973
commit
6f3ef1d1fe
|
@ -1,10 +1,20 @@
|
|||
Have a feature you want to implement into Statping!? Awesome! Follow this guide to see how you can test, compile and build Statping for production use. I recommend you use `make` with this process, it will save you time and it will auto include many customized parameters to get everything working correctly.
|
||||
Have a feature you want to implement into Statping!? Awesome! Follow this guide
|
||||
to see how you can test, compile and build Statping for production use. I
|
||||
recommend you use `make` with this process, it will save you time and it will
|
||||
auto-include many customized parameters to get everything working correctly.
|
||||
|
||||
# Dependencies
|
||||
Statping has a couple of required dependencies when testing and compiling the binary. The [Makefile](https://github.com/hunterlong/statping/blob/master/Makefile) will make these tasks a lot easier. Take a look at the Makefile to see what commands are ran. Run the command below to get setup right away.
|
||||
|
||||
Statping has a couple of required dependencies when testing and compiling the
|
||||
binary. The [Makefile](https://github.com/hunterlong/statping/blob/master/Makefile)
|
||||
will make these tasks a lot easier. Take a look at the Makefile to see what
|
||||
commands are running. Run the command below to get setup right away.
|
||||
|
||||
```bash
|
||||
make dev-deps
|
||||
```
|
||||
|
||||
|
||||
List of requirements for compiling assets, building binary, and testing.
|
||||
- [Go Language](https://golang.org/) (currently `1.10.3`)
|
||||
- [Docker](https://docs.docker.com/)
|
||||
|
@ -12,50 +22,99 @@ List of requirements for compiling assets, building binary, and testing.
|
|||
- [Cypress](https://www.cypress.io/) (only used for UI testing, `make cypress-install`)
|
||||
|
||||
# Compiling Assets
|
||||
This Golang project uses [rice](https://github.com/GeertJohan/go.rice) to compile static assets into a single file. The file `source/rice-box.go` is never committed to the Github repo, it is automatically created on build. Statping also requires `sass` to be installed on your local OS. To compile all the static assets run the command below:
|
||||
|
||||
This Golang project uses [rice](https://github.com/GeertJohan/go.rice) to
|
||||
compile static assets into a single file. The file `source/rice-box.go` is never
|
||||
committed to the Github repo, it is automatically created on the build. Statping
|
||||
also requires `sass` to be installed on your local OS. To compile all the
|
||||
static assets run the command below:
|
||||
|
||||
```bash
|
||||
make compile
|
||||
```
|
||||
After this is complete, you'll notice the `source/rice-box.go` file has been generated. You can now continue to build, and test.
|
||||
|
||||
After this is complete, you'll notice the `source/rice-box.go` file has been
|
||||
generated. You can now continue to build, and test.
|
||||
|
||||
# Testing
|
||||
Statping includes multiple ways to Test the application, you can run the `make` command, or the normal `go test` command. To see the full experience of your updates, you can even run Cypress tests which is in the `.dev/test` folder.
|
||||
|
||||
Statping will run all tests in `cmd` folder on MySQL, Postgres, and SQLite databases. You can run `make databases` to automatically create MySQL and Postgres with Docker.
|
||||
Statping includes multiple ways to Test the application, you can run the `make`
|
||||
command, or the normal `go test` command. To see the full experience of your
|
||||
updates, you can even run Cypress tests which are in the `.dev/test` folder.
|
||||
|
||||
Statping will run all tests in the `cmd` folder on MySQL, Postgres, and SQLite
|
||||
databases. You can run `make databases` to automatically create MySQL and
|
||||
Postgres with Docker.
|
||||
|
||||
###### Go Unit Testing:
|
||||
|
||||
```bash
|
||||
make test
|
||||
```
|
||||
|
||||
###### Cypress UI Testing:
|
||||
|
||||
```bash
|
||||
make cypress-test
|
||||
```
|
||||
|
||||
###### Test Everything:
|
||||
|
||||
```bash
|
||||
make test-all
|
||||
```
|
||||
|
||||
# Build
|
||||
Statping will build on all operating systems except Windows 32-bit. I personally use [xgo](https://github.com/karalabe/xgo) to cross-compile on multiple systems using Docker. Follow the commands below to build on your local system.
|
||||
|
||||
Statping will build on all operating systems except Windows 32-bit. I
|
||||
personally use [xgo](https://github.com/karalabe/xgo) to cross-compile on
|
||||
multiple systems using Docker. Follow the commands below to build on your local
|
||||
system.
|
||||
|
||||
###### Build for local operating system:
|
||||
|
||||
```bash
|
||||
make build
|
||||
```
|
||||
|
||||
# Compile for Production
|
||||
Once you've tested and built locally, you can compile Statping for all available operating systems using the command below. This command will require you to have Docker.
|
||||
|
||||
Once you've tested and built locally, you can compile Statping for all available
|
||||
operating systems using the command below. This command will require you to have
|
||||
[Docker](http://docker.io/).
|
||||
|
||||
```bash
|
||||
make build-all
|
||||
```
|
||||
|
||||
# What Now
|
||||
Everything tested, compiled and worked out!? Awesome! 💃 You can now commit your changes, and submit a Pull Request with the features/bugs you added or removed.
|
||||
|
||||
Everything tested, compiled and worked out!? Awesome! 💃 You can now commit your
|
||||
changes, and submit a Pull Request with the features/bugs you added or removed.
|
||||
|
||||
Please remember to also add the Changelog Entry to describe what you have
|
||||
changed by using[changelog-go](https://gitlab.com/l0nax/changelog-go).
|
||||
|
||||
If your PR is related to an Issue (ie. on a bug fix or when adding a new notifier)
|
||||
don't forget adding the related GitHub Issue ID like this: `[#270](https://github.com/hunterlong/statping/issues/270)`
|
||||
Check out the example below.
|
||||
Adding _one_ changelog entry should be done in a separate Commit - not only
|
||||
because this is a good Committing practice, also because it's separated by your
|
||||
Changes.
|
||||
When you fix/ add/ ... more than one thing than please describe it a good, short
|
||||
and precise sentence. Because everyone wants a good and nice-looking `CHANGELOG.md`
|
||||
where all changes of a new Version are documented.
|
||||
|
||||
###### Example for fixing a bug in the UI
|
||||
|
||||
```bash
|
||||
~] changelog new "Fix zooming out on graph doesn't load additional data ([#270](https://github.com/hunterlong/statping/issues/270))"
|
||||
[0] New Feature (Added)
|
||||
[1] Bug Fix (Fixed)
|
||||
[2] Feature change (Changed)
|
||||
[3] New deprecation (Deprecated)
|
||||
[4] Feature removal (Removed)
|
||||
[5] Security fix (Security)
|
||||
[6] Other (Other)
|
||||
>> 1
|
||||
```
|
Loading…
Reference in New Issue