38 lines
938 B
Makefile
38 lines
938 B
Makefile
DIST_NAME=superhero
|
|
DIST_PATH=dist
|
|
PACKAGE_PATH=github.com/eslider/superherohub
|
|
BINARY_PATH=${DIST_PATH}/${DIST_NAME}
|
|
|
|
# Build the project
|
|
build:
|
|
go build -o ${BINARY_PATH} ${PACKAGE_PATH}
|
|
|
|
|
|
# Run the project
|
|
run:
|
|
go build -o ${BINARY_PATH} ${PACKAGE_PATH}
|
|
${BINARY_PATH}
|
|
|
|
|
|
# Test and build the project
|
|
test:
|
|
go test -v -cover ${PACKAGE_PATH}/pkg/deesee
|
|
go test -v -cover ${PACKAGE_PATH}/pkg/people
|
|
go test -v -cover -count 10 ${PACKAGE_PATH}
|
|
|
|
# This test ork only by developer
|
|
# Please ignore this
|
|
test-store:
|
|
curl -v -X PUT \
|
|
-H 'Accept: */*' \
|
|
-H 'Connection: keep-alive' \
|
|
-H 'Cache-Control: no-cache' \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"name":"supermans","identity":{"firstName":"Kent","lastName":"Clark"},"superpowers":["flight","strength","invulnerability"],"birthday":"1977-04-18"}' \
|
|
http://127.0.0.1:8080/superheroes
|
|
|
|
# Clean the project
|
|
clean:
|
|
go clean
|
|
rm ${BINARY_PATH}
|