我在下面有多个服务器和capistrano任务
before 'deploy:starting', 'elb:deregister'
before 'deploy:finishing', 'elb:register'
after 'deploy:publishing', 'deploy:restart'
after 'deploy:failed', 'elb:deregister'
当我像下面这样部署时
before 'deploy:starting', 'elb:deregister' -> server1
before 'deploy:starting', 'elb:deregister' -> server1
...
...
如何按如下顺序部署
Server1
before 'deploy:starting', 'elb:deregister'
before 'deploy:finishing', 'elb:register'
after 'deploy:publishing', 'deploy:restart'
after 'deploy:failed', 'elb:deregister'
Server2
before 'deploy:starting', 'elb:deregister'
before 'deploy:finishing', 'elb:register'
after 'deploy:publishing', 'deploy:restart'
after 'deploy:failed', 'elb:deregister'
答案 0 :(得分:0)
您在这里有多个选择。
假设您有这样的上限配置:
buildTypes {
release {
minifyEnabled false
shrinkResources false
zipAlignEnabled true
debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
您可以执行此操作;
server 'server_1', user: 'deploy', roles: %w[app db web]
server 'server_2', user: 'deploy', roles: %w[app]
cap production deploy
有用而又简单却很愚蠢。
您可以像生产2一样设置另一个部署环境并运行cap production deploy
赋予服务器不同的角色,并像这样更改您的任务和配置:
cap production deploy; cap production2 deploy