Files
houston-be/Makefile
Vijay Joshi 928a768b82 TP-48197 : Implementation of RCA Service, repo, handler, validator and webhook for posting RCA to incident channel along with unit tests (#282)
* TP-48197 : Implementation of RCA Service, repo, handler, validator and webhook for posting RCA to incident channel

* Added unit tests

* Added migration script"

* PR Review Changes

* Update migratrion
2023-11-16 12:03:34 +05:30

40 lines
1.4 KiB
Makefile

.PHONY: docker-run
docker-run: docker-build
docker run houston
.PHONY: docker-build
docker-build:
docker build -t houston -f Dockerfile.houston .
.PHONY: migration-up
migration-up:
migrate -path db/migration/ -database "${POSTGRES_DSN}?sslmode=disable" -verbose up
.PHONY: migration-down
migration-down:
migrate -path db/migration/ -database "${POSTGRES_DSN}?sslmode=disable" -verbose down
.PHONY: build
build: test
go mod tidy && CGO_ENABLED=0 go build -ldflags="-s -w" -o houston cmd/main.go
.PHONY: test
test: generatemocks
go test -v -count=1 $(CURDIR)/service/...
@rm -rf $(CURDIR)/mocks
# Keep all mock file generation below this line
.PHONY: generatemocks
generatemocks:
@go install github.com/gojuno/minimock/v3/cmd/minimock@v3.1.3
@go mod tidy
@rm -rf $(CURDIR)/mocks
@echo "Generating mocks..."
@mkdir "mocks"
cd $(CURDIR)/pkg/google/googleDrive && minimock -i GoogleDriveActions -s _mock.go -o $(CURDIR)/mocks
cd $(CURDIR)/pkg/conference && minimock -i ICalendarActions -s _mock.go -o $(CURDIR)/mocks
cd $(CURDIR)/pkg/rest/ && minimock -i ClientActions -s _mock.go -o $(CURDIR)/mocks
cd $(CURDIR)/service/slack && minimock -i ISlackService -s _mock.go -o $(CURDIR)/mocks
cd $(CURDIR)/service/incident && minimock -i IIncidentService -s _mock.go -o $(CURDIR)/mocks
cd $(CURDIR)/repository/rca && minimock -i IRcaRepository -s _mock.go -o $(CURDIR)/mocks