4 Star 61 Fork 19

花菜/AnotherFasterRunner

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
花菜 提交于 2023-04-27 10:22 . chore(Makefile): add fast up
#.PHONY: up logs up-tag down build build-tag ps config exec restart
env := ${env}
HOME_ENV := ${HOME}/.env
CURRENT_ENV := .env.example
env-file := $(CURRENT_ENV)
ifndef ENV_FILE
ifneq ($(wildcard $(HOME_ENV)),)
env-file := $(HOME_ENV)
else
WARN_MSG := $(warning WARNING: ${HOME_ENV} not found and no ENV_FILE provided, using .env.example instead)
endif
else
env-file := $(ENV_FILE)
endif
compose-file := docker-compose.yml
ifdef COMPOSE_FILE
compose-file := $(COMPOSE_FILE)
endif
cmd = docker-compose -f $(compose-file) --env-file $(env-file)
tag := $(tag)
service := $(word 1,$(MAKECMDGOALS))
.PHONY: fastup
fastup:
docker-compose -f docker-compose-for-fastup.yml --env-file .env.example up -d --build --remove-orphans
docker-compose -f docker-compose-for-fastup.yml --env-file .env.example restart nginx web
.PHONY: up
up:
$(cmd) up -d --build --remove-orphans
$(cmd) restart nginx
$(cmd) restart web
.PHONY: up-no-build
up-no-build:
$(cmd) up -d --remove-orphans
$(cmd) restart nginx
$(cmd) restart web
.PHONY: up-tag
up-tag:
export TAG=$(tag); $(cmd) up -d --build --remove-orphans
$(cmd) restart nginx
$(cmd) restart web
.PHONY: down
down:
$(cmd) down
.PHONY: build
build:
# build latest
$(cmd) build
git-tag:
git checkout $(tag)
.PHONY: build-tag
build-tag:git-tag
# Build the image with the tag
export TAG=$(tag); $(cmd) build
.PHONY: config
config:
$(cmd) config
.PHONY: ps
ps:
$(cmd) ps
.PHONY: logs
logs:
$(cmd) logs -f app celery-worker web nginx
.PHONY: restart
restart:
$(cmd) restart $(service)
.PHONY: exec
exec:
$(cmd) exec $(service) /bin/bash
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lihuacai/AnotherFasterRunner.git
git@gitee.com:lihuacai/AnotherFasterRunner.git
lihuacai
AnotherFasterRunner
AnotherFasterRunner
master

搜索帮助