我正在使用基于Cloud模板的IBM管道。模板给你蓝绿部署。
我的舞台部署脚本如下所示:
#!/bin/bash
cat << EOF > ${WORKSPACE}/manifest.yml
declared-services:
my_cloudant:
label: cloudantNoSQLDB
plan: Lite
my_messagehub:
label: messagehub
plan: standard
my_autoscaling:
label: Auto-Scaling
plan: free
my_availability_monitoring:
label: AvailabilityMonitoring
plan: Lite
applications:
- name: movie-recommend-demo
host: movie-recommend-demo
buildpack: https://github.com/cloudfoundry/python-buildpack.git#v1.5.18
memory: 128M
instances: 2
path: web_app
services:
- my_cloudant
- my_messagehub
- my_autoscaling
- my_availability_monitoring
timeout: 180
env:
# these are set in the devops stage ENVIRONMENT PROPERTIES
BI_HIVE_USERNAME: ${BI_HIVE_USERNAME}
BI_HIVE_PASSWORD: ${BI_HIVE_PASSWORD}
BI_HIVE_HOSTNAME: ${BI_HIVE_HOSTNAME}
EOF
# Push app
if ! cf app $CF_APP; then
cf push $CF_APP
else
OLD_CF_APP=${CF_APP}-OLD-$(date +"%s")
rollback() {
set +e
if cf app $OLD_CF_APP; then
cf logs $CF_APP --recent
cf delete $CF_APP -f
cf rename $OLD_CF_APP $CF_APP
fi
exit 1
}
set -e
trap rollback ERR
cf rename $CF_APP $OLD_CF_APP
cf push $CF_APP
cf delete $OLD_CF_APP -f
fi
# TODO:
# - Reconfigure Availability Monitoring on Green deployment
# - Reconfigure Autoscaling on Green deployment (https://console.bluemix.net/docs/cli/plugins/auto-scaling/index.html)
# Export app name and URL for use in later Pipeline jobs
export CF_APP_NAME="$CF_APP"
export APP_URL=http://$(cf app $CF_APP_NAME | grep urls: | awk '{print $2}')
# View logs
#cf logs "${CF_APP}" --recent在搭建和运行这个平台之前,我在云铸造应用程序上进行了可用性监控设置。运行这个阶段导致我的可用性监视配置被删除。
如何使用脚本自动重新配置新的“绿色”部署中的可用性监视?
对于自动缩放,我有一个类似的问题,但似乎有一个API/CLI可以用来重新配置该服务。但是,我遇到了使用a problem的cf oauth-token
发布于 2017-06-22 12:38:20
这是目前服务中的一个缺陷,目前正在积极开展工作,应在今年晚些时候提供。目前,保持配置的方法不是删除应用程序,而是重用2个应用程序。即使您只将服务绑定到一个应用程序,特别是当您使用监视选项卡时,这也会变得有些混乱。当自我监控时,我们所做的就是在空间中创建一个虚拟应用程序,并将服务绑定到它(它甚至不需要运行)。然后我们使用它来监控蓝色/绿色的应用程序。在这里,我们也不删除应用程序,只是重用应用程序。
https://stackoverflow.com/questions/44667141
复制相似问题