2016-04-29 15:58:17 +02:00
|
|
|
# Pull Requests
|
|
|
|
|
|
|
|
When creating a pull-request you should:
|
|
|
|
|
|
|
|
- __Open an issue first:__ Confirm that the change or feature will be accepted
|
|
|
|
- __gofmt and vet the code:__ Use `gofmt`, `golint`, `govet` and `goimports` to clean up your code.
|
2017-01-11 01:33:07 +01:00
|
|
|
- __Update api documentation:__ If your pull-request adding/modifying an API request, make sure you update the swagger documentation (`api-docs.yml`)
|
2016-04-29 15:58:17 +02:00
|
|
|
|
2017-02-22 12:51:23 +01:00
|
|
|
# Installation in a development environment
|
2016-11-15 16:02:39 +01:00
|
|
|
|
2017-02-22 12:51:23 +01:00
|
|
|
- [Install Go](https://golang.org/doc/install)
|
|
|
|
- Install MySQL / MariaDB
|
|
|
|
- Install node.js
|
2016-04-29 15:58:17 +02:00
|
|
|
|
2017-03-08 16:28:55 +01:00
|
|
|
1) Set up GOPATH, GOBIN and Workspace
|
2016-11-15 16:02:39 +01:00
|
|
|
|
|
|
|
```
|
2017-03-08 16:28:55 +01:00
|
|
|
cd {WORKING_DIRECTORY}
|
|
|
|
export GOPATH=`pwd`
|
|
|
|
export GOBIN=$GOPATH/bin
|
|
|
|
export PATH=$PATH:$GOBIN
|
|
|
|
|
2017-02-22 12:51:23 +01:00
|
|
|
mkdir -p $GOPATH/src/github.com/ansible-semaphore && cd $GOPATH/src/github.com/ansible-semaphore
|
2016-11-15 16:02:39 +01:00
|
|
|
```
|
|
|
|
|
2017-02-22 12:51:23 +01:00
|
|
|
2) Clone semaphore (with submodules)
|
2016-11-15 16:02:39 +01:00
|
|
|
|
2016-11-15 16:05:18 +01:00
|
|
|
```
|
2017-02-22 12:51:23 +01:00
|
|
|
git clone --recursive git@github.com:ansible-semaphore/semaphore.git && cd semaphore
|
2016-11-15 16:05:18 +01:00
|
|
|
```
|
2016-04-30 09:52:33 +02:00
|
|
|
|
2017-02-22 12:51:23 +01:00
|
|
|
3) Install dev dependencies
|
2016-11-15 16:02:39 +01:00
|
|
|
|
|
|
|
```
|
2017-03-08 16:28:55 +01:00
|
|
|
go get ./... github.com/cespare/reflex github.com/jteeuwen/go-bindata/... github.com/mitchellh/gox
|
2016-11-15 16:02:39 +01:00
|
|
|
npm install async
|
2017-02-22 12:51:23 +01:00
|
|
|
npm install -g nodemon pug-cli less
|
2016-04-29 15:58:17 +02:00
|
|
|
```
|
|
|
|
|
2017-02-22 12:51:23 +01:00
|
|
|
4) Set up config, database & run migrations
|
2016-04-29 15:58:17 +02:00
|
|
|
|
2016-11-15 16:02:39 +01:00
|
|
|
```
|
|
|
|
cat <<EOT >> config.json
|
|
|
|
{
|
|
|
|
"mysql": {
|
|
|
|
"host": "127.0.0.1:3306",
|
2017-02-22 12:51:23 +01:00
|
|
|
"user": "root",
|
|
|
|
"pass": "",
|
2016-11-15 16:02:39 +01:00
|
|
|
"name": "semaphore"
|
|
|
|
},
|
2017-02-22 12:51:23 +01:00
|
|
|
"port": ":3000"
|
2016-11-15 16:02:39 +01:00
|
|
|
}
|
|
|
|
EOT
|
|
|
|
|
2017-02-22 12:51:23 +01:00
|
|
|
echo "create database semaphore;" | mysql -uroot -p
|
2017-03-08 16:28:55 +01:00
|
|
|
go-bindata -debug -o util/bindata.go -pkg util config.json db/migrations/ $(find public/* -type d -print)
|
2017-02-22 12:51:23 +01:00
|
|
|
go run cli/main.go -config ./config.json -migrate
|
2016-05-21 00:07:27 +02:00
|
|
|
```
|
2016-11-15 16:02:39 +01:00
|
|
|
|
2017-02-22 12:51:23 +01:00
|
|
|
Now it's ready to start.. Run `./make.sh watch`
|
2016-11-15 16:02:39 +01:00
|
|
|
|
2017-02-22 12:51:23 +01:00
|
|
|
- Watches js files in `public/js/*` and compiles into a bundle
|
|
|
|
- Watches css files in `public/css/*` and compiles into css code
|
|
|
|
- Watches pug files in `public/html/*` and compiles them into html
|
|
|
|
- Watches go files and recompiles the binary
|
|
|
|
- Open [localhost:3000](http://localhost:3000)
|