capistrano 执行 Makefile 失败
capistrano excute Makefile fail
我在执行 Makefile 时遇到问题
deploy.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"
当 运行 "cap production deploy"
时出错
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
我在执行 Makefile 时遇到问题
deploy.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"
当 运行 "cap production deploy"
时出错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