42 lines
		
	
	
		
			796 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			796 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
| .PHONY: all init deps install test lint run stop
 | |
| 
 | |
| run:
 | |
| 	go build
 | |
| 	./gralias start
 | |
| 
 | |
| init:
 | |
| 	go mod init
 | |
| 
 | |
| # install all dependencies used by the application
 | |
| deps:
 | |
| 	go clean -modcache
 | |
| 	go mod download
 | |
| 
 | |
| # install the application in the Go bin/ folder
 | |
| install:
 | |
| 	go install ./...
 | |
| 
 | |
| test:
 | |
| 	go test ./...
 | |
| 
 | |
| lint:
 | |
| 	golangci-lint run --config .golangci.yml
 | |
| 
 | |
| gen:
 | |
| 	go generate ./...
 | |
| 
 | |
| build-container:
 | |
| 	docker build -t gralias:master .
 | |
| 
 | |
| stop-container:
 | |
| 	docker rm -f gralias 2>/dev/null && echo "old container removed"
 | |
| 
 | |
| run-container: stop-container
 | |
| 	docker run --name=gralias -v $(CURDIR)/store.json:/root/store.json -p 0.0.0.0:3000:3000 -d gralias:master
 | |
| 
 | |
| migrate-up:
 | |
| 	migrate -database 'sqlite3://gralias.db' -path migrations up
 | |
| 
 | |
| migrate-down:
 | |
| 	migrate -database 'sqlite3://gralias.db' -path migrations down
 | 
