gpt4 book ai didi

ruby-on-rails - capistrano 执行 Makefile 失败

转载 作者:行者123 更新时间:2023-12-04 18:46:24 25 4
gpt4 key购买 nike

我对执行 Makefile 有疑问

部署.rb:

namespace :deploy do
after :deploy, :build_app do
on roles(:app), in: :groups do
execute "make production"
end
end
end

生成文件:
production:
echo "make file production"
staging:
echo "make file staging"
all:
echo "make file all"

运行“上限生产部署”时出错
DEBUG [1f0a117d] Command: make production
DEBUG [1f0a117d] make: *** No rule to make target `production'. Stop.
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as make production exit status: 2
make production stdout: make: *** No rule to make target `production'. Stop.
make production stderr: Nothing written

在服务器“make production”上直接调试运行=> echo“make file production”

如果只使用“make”执行,它将运行到第一个标签

--- Makefile 添加
production:
npm install
npm run deploy-production
sudo docker rmi dashboard:latest; sudo echo 0
sudo docker build -t dashboard:$(VERSION) .
sudo docker tag -f dashboard:$(VERSION) dashboard:latest

staging:
npm install
npm run deploy-staging
sudo docker rmi dashboard:latest; sudo echo 0
sudo docker build -t dashboard:$(VERSION) .
sudo docker tag -f dashboard:$(VERSION) dashboard:latest

最佳答案

make env 的正确语法:

namespace :deploy do
after :deploy, :build_app do
on roles(:app), in: :groups do
execute 'make','production'
end
end
end

关于ruby-on-rails - capistrano 执行 Makefile 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36935487/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com