Bluemix:cf push使用DEA而不是DIEGO架构

时间:2017-04-11 10:15:38

标签: ibm-cloud

将应用程序部署到专用Bluemix时,默认情况下使用DEA体系结构。我怎样才能强迫它使用DIEGO架构呢?

2 个答案:

答案 0 :(得分:1)

您必须使用更多步骤。部署无需启动,切换到diego,启动。

if (this.state.file) {
            var file = this.state.file;
            if (window.FormData !== undefined) {
                var data = new FormData();
                data.append("file", file);

                $.ajax({
                    type: "POST",
                    url: "/api/service/upload",
                    contentType: "text/csv",
                    processData: false,
                    data: data,
                    success: function (result) {
                        console.log(result);
                    },
                    error: function (xhr, status, p3, p4) {
                        var err = "Error " + " " + status + " " + p3 + " " + p4;
                        if (xhr.responseText && xhr.responseText[0] == "{")
                            err = JSON.parse(xhr.responseText).Message;
                        console.log(err);
                    }
                });
            }
        }

参考Deploying Apps

答案 1 :(得分: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

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

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

如果你这样做,只需运行dos2unix命令,它就会“修复”行结尾以匹配你的操作系统。