2017-04-11 24 views

回答

1

你必须使用更多的步骤。无需开始部署,切换到迭代,启动。

cf push APPLICATION_NAME --no-start 
cf disable-diego APPLICATION_NAME 
cf start APPLICATION_NAME 

参考Deploying Apps

0

我建一个bash exec来做到这一点,这将使用现有的manifest.yml文件和包装这一切到一个单一的请求。在bash EXEC的内容如下:

#!/bin/bash 

filename="manifest.yml" 
if [ -e $filename ]; 
then 
    echo "using manifest.yml file in this directory" 
else 
    echo "no manifest.yml file found. exiting" 
    exit -2 
fi 
shopt -s nocasematch 
string='name:' 
targetName="" 
echo "Retrieving name from manifest file" 
while read -r line 
do 
    name="$line" 
    variable=${name%%:*} 
    if [[ $variable == *"name"* ]] 
    then 
     inBound=${name#*:} 
     targetName="$(echo -e "${inBound}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" 
    fi 
done < "$filename" 
if [ "$targetName" == "" ]; 
then 
    echo "Could not find name of application in manifest.yml file. Cancelling build." 
    echo "application name is identified by the 'name: ' term in the manifest.yml file" 
    exit -1 
else 
    echo "starting cf push for $targetName" 

    cf push --no-start 

    echo "cf enable-diego $targetName" 
    cf enable-diego $targetName 

    echo "cf start $targetName" 
    cf start $targetName 

    exit 0 
fi 

只是把这个代码到编辑器作为一个新的文件,然后使文件的可执行文件。我在每个根目录的仓库中都保留了这个exec的副本。做一个复制粘贴并执行此exec后,您可能会收到以下错误:

/bin/bash^M: bad interpreter: No such file or directory 

如果你做什么,只要运行DOS2UNIX的命令,它会“修复了”行结束,以配合您的操作系统。