mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-12-03 14:51:05 +01:00
ef77120c0e
change pug to pug-cli
3.5 KiB
3.5 KiB
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
andgoimports
to clean up your code. - Update api documentation: If your pull-request adding/modifying an API request, make sure you update the swagger documentation (
swagger.yml
)
Installing dependencies
First of all you'll need the Go Language and Node.js installed. If you dont have them installed, you can follow these steps:
- Create a directory called 'bin' in home that will receive the lib files from GoLang and Node.js:
mkdir ~/bin
cd ~/bin
wget https://storage.googleapis.com/golang/go1.7.3.linux-amd64.tar.gz
wget https://nodejs.org/dist/v6.9.1/node-v6.9.1-linux-x64.tar.xz
tar xvf go1.7.3.linux-amd64.tar.gz
tar xvf node-v6.9.1-linux-x64.tar.xz
mv go golang
mv node-v6.9.1-linux-x64 node-js
ln -s ~/bin/golang/bin/go ./go
ln -s ~/bin/golang/bin/godoc ./godoc
ln -s ~/bin/golang/bin/gofmt ./gofmt
ln -s ~/bin/node-js/bin/node ./node
ln -s ~/bin/node-js/bin/npm ./npm
- Create project path and clone the repository with --recursive:
mkdir ~/GoProjects/src/github.com/ansible-semaphore/
cd ~/GoProjects/src/github.com/ansible-semaphore/
git clone --recursive git@github.com:ansible-semaphore/semaphore.git
- Add environment variables to .profile (or .bashrc) need by go and npm (Don't forget to use source on file or reopen the terminal after):
PATH=/~/bin:/~/GoProjects/bin:/~/.npm-global/bin:$PATH
GOPATH=~/GoProjects
GOROOT=~/bin/golang
NPM_CONFIG_PREFIX=~/.npm-global
export PATH GOPATH GOROOT NPM_CONFIG_PREFIX
- Clone project and Install go dependencies:
cd ~/GoProjects/src/github.com/ansible-semaphore/
git clone --recursive https://github.com/ansible-semaphore/semaphore.git
go get github.com/jteeuwen/go-bindata/...
go get github.com/mitchellh/gox
go get github.com/cespare/reflex
go get -u ./...
- Install node.js dependencies:
cd ~/GoProjects/src/github.com/ansible-semaphore/
npm install -g less pug-cli
npm install async
- OPTIONAL: Create a MySQL Container to develop (or install and setup One):
docker run -d --name semaphore-db -v semaphore-data:/var/lib/mysql -p 3306:3306 -e MYSQL_USER=semaphore -e MYSQL_DATABASE=semaphore -e MYSQL_PASSWORD=semaphore -e MYSQL_ROOT_PASSWORD=semaphore mysql
- Download the 2.0.4 version into main directory and run the setup to trigger the db migration:
wget https://github.com/ansible-semaphore/semaphore/releases/download/v2.0.4/semaphore_linux_amd64
chmod +x semaphore_linux_amd64
./semaphore_linux_amd64 -setup
- Created a config.json which have the Database information to start the development:
cat <<EOT >> config.json
{
"mysql": {
"host": "127.0.0.1:3306",
"user": "semaphore",
"pass": "semaphore",
"name": "semaphore"
},
"session_db": "127.0.0.1:6379",
"port": ":8010"
}
EOT
- Start the Watch process:
./make.sh watch
- Point your browser to localhost:8010. Enjoy.
Other Informations
For more information about GoPaths take a look at (go wiki, tutorial, SO question).
You will need to have a local config.json
file because it is linked to. It should contain your local configuration.