-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
24 lines (18 loc) · 827 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
SHELL:=/bin/bash
DOCKER_REGISTRY_NAME=registry.cn-chengdu.aliyuncs.com/dysodeng/app
PLATFORM_ARCH=linux/amd64
PROD_DOCKER_REGISTRY_NAME=registry.cn-chengdu.aliyuncs.com/dysodeng/app-release
PROD_PLATFORM_ARCH=linux/amd64
IMAGE_VERSION=$(shell date +"%Y%m%d%H%M")
.PHONY: run lint build
# go install github.com/pilu/fresh 全局安装fresh命令,热更新代码
run:
cp -f ./.env ./var/tmp/.env && fresh -c dev-run.conf
lint:
go fmt ./internal/... && go fmt ./cmd/... && go fmt ./main.go
build:
docker buildx build --platform ${PLATFORM_ARCH} -t ${DOCKER_REGISTRY_NAME}:${IMAGE_VERSION} .
docker push ${DOCKER_REGISTRY_NAME}:${IMAGE_VERSION}
build-prod:
docker buildx build --platform ${PROD_PLATFORM_ARCH} -t ${PROD_DOCKER_REGISTRY_NAME}:${IMAGE_VERSION} .
docker push ${PROD_DOCKER_REGISTRY_NAME}:${IMAGE_VERSION}