Wednesday, 26 April 2017

How to run a Go server in Travis-ci?

I'm working on a Go project that exposes a RESTful http API.

I want to run the Go project and use Nodejs (Mocha) to test the endpoints. It seems as if the nohup command doesn't keep running in the background.

Locally everything works but I don't seem to be able to get it running in Travis-ci.

language: go
go:
  - 1.8
env:
  - "PATH=/home/travis/gopath/bin:$PATH"
before_install:
  - go get ./...
script:
  - npm install mocha -g
  - npm install
  - nohup go run ./cmd/server/main.go --scheme=http --port=8080 --host=127.0.0.1 &
  - mocha



via Bob van Luijt

No comments:

Post a Comment