Files
houston-be/Makefile
Vijay Joshi 527ba2c04f TP-44155, TP-47355 : Update incident web refractor + Update severity slack refractor with unit tests (#262)
* TP-44155 : Update incident web refractor

* Resolution of v1 and v2 service calls

* PR review changes

* Rebase fixes

* TP-47355 : Add slack update severity refractor

* Cors fix

* Rebase fix

* Second PR revice changes

* More review changes

* Add concurrency to slack calls

* rebase

* Setup interfaces

* Added unit tests for update incident refractor

* Add more test cases

* Rebase changes

* Fix responder addeb by

* Fix build error

* Fix concurretn slack calls

* Revert rebase bug

* Shorten function length: added slack workflows

* Made fucntion size smaller
2023-11-30 14:24:29 +05:30

48 lines
2.1 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
cd $(CURDIR)/service/incident_channel && minimock -i IIncidentChannelService -s _mock.go -o $(CURDIR)/mocks
cd $(CURDIR)/model/team && minimock -i ITeamRepository -s _mock.go -o $(CURDIR)/mocks
cd $(CURDIR)/model/severity && minimock -i ISeverityRepository -s _mock.go -o $(CURDIR)/mocks
cd $(CURDIR)/model/incident && minimock -i IIncidentRepository -s _mock.go -o $(CURDIR)/mocks
cd $(CURDIR)/model/user && minimock -i IUserRepository -s _mock.go -o $(CURDIR)/mocks
cd $(CURDIR)/pkg/documentService && minimock -i ServiceActions -s _mock.go -o $(CURDIR)/mocks
cd $(CURDIR)/repository/rcaInput && minimock -i IRcaInputRepository -s _mock.go -o $(CURDIR)/mocks
cd $(CURDIR)/model/user && minimock -i IUserRepositoryInterface -s _mock.go -o $(CURDIR)/mocks