fake-sms/Makefile

58 lines
1.2 KiB
Makefile

DOCKER_DATE_TAG := $(shell date +%Y%m%d%H%M)
build:
CGO_ENABLED=0 go build -v -o bin/fake-sms ./cmd/fake-sms
docker-image:
docker build \
--build-arg HTTP_PROXY=$(HTTP_PROXY) \
--build-arg HTTPS_PROXY=$(HTTPS_PROXY) \
--build-arg http_proxy=$(http_proxy) \
--build-arg https_proxy=$(https_proxy) \
-t fake-sms:latest \
-f ./misc/docker/Dockerfile \
.
docker-run:
docker run \
--rm -it \
-p 3000:3000 \
--tmpfs /app/data \
fake-sms:latest
docker-release:
docker tag fake-sms:latest reg.cadoles.com/cadoles/fake-sms:latest
docker tag fake-sms:latest reg.cadoles.com/cadoles/fake-sms:$(DOCKER_DATE_TAG)
docker login reg.cadoles.com
docker push reg.cadoles.com/cadoles/fake-sms:latest
docker push reg.cadoles.com/cadoles/fake-sms:$(DOCKER_DATE_TAG)
test:
go test -v -race ./...
release: dist
@./misc/script/release.sh
dist:
npm run build
tidy:
go mod tidy
watch:
go get github.com/cortesi/modd/cmd/modd
go run github.com/cortesi/modd/cmd/modd
lint:
golangci-lint run --enable-all
tooling:
go get github.com/krishicks/yaml-patch/cmd/yaml-patch
clean:
rm -rf release
rm -rf data
rm -rf vendor
rm -rf bin
.PHONY: lint watch build vendor tidy release