-
Golang prerequisites and
$GOPATH
setup. NOTE: Stick to Golang version 1.11 because of goa and golang 1.11. Have a look how Go Version Manager can help you simplifying configuration and management of different versions of Go. -
clone the repo in your GOPATH:
$ git clone https://github.com/fabric8-services/build-tool-detector $GOPATH/src/github.com/fabric8-services/build-tool-detector
$ make build
This will perform following actions: fetch dependencies, generate Goa files from design folder, compile.
When in doubt just make help
.
$ export TOKEN=XXXX
$ curl -X GET "http://localhost:8099/api/detect/build/https%3A%2F%2Fgithub.com%2Ffabric8-launcher%2Flauncher-backend" -H "accept: application/vnd.goa.build.tool.detector+json" -H "Authorization: Bearer $TOKEN"
{"build-tool-type":"maven"}
where:
-
TOKEN is your JWT token taken from OpenShift.io prod-preview
-
and our parameter repo is: https://github.com/fabric8-launcher/launcher-backend
In order to continuously run the tests whenever code change occur execute following command from the root directory of the project:
$ make test
and keep it running in the terminal.
Run the server:
$ make run
NoteOur service’s configuration uses viper. To setup dependent service like fabric8-auth prod or prod-preview, please check configuration file or set env variable like BUILD_TOOL_DETECTOR_AUTH_URI