0

CodeDeploy を介してデプロイするときに、Elastic Load Balancer を処理するためのバット スクリプト (Windows Server 用) はありますか? Linux用のスクリプトのみが見つかりました:

https://github.com/awslabs/aws-codedeploy-samples/tree/master/load-balancing/elb

残念ながら、彼らは Windows Server のサポートに関するドキュメントにも言及していません。

http://docs.aws.amazon.com/codedeploy/latest/userguide/elastic-load-balancing-integ.html

4

1 に答える 1

0

Amazon からの公式の回答はこのトピックにリンクしており、「誰か」が Cygwin を使用しているとのことで、私も試してみる必要があります...

残念ながら、他に可能性はありませんでしたが、Cygwin をインストールし、appspec.ymlに次のように記述しました。

version: 0.0
os: windows
files:
  - source: \xxx\
    destination: C:\xxx\
hooks:
  ApplicationStop:
    - location: \deregister_from_elb.bat
      timeout: 900

<next steps here>

  ApplicationStart:
    - location: \register_with_elb.bat
      timeout: 900

deregister_from_elb.batファイルで、次のように Cygwin で.shファイルを実行します。

@echo off

SET mypath=%~dp0
SET mypath=%mypath:~3%

C:\cygwin64\bin\bash.exe -l -c "'/cygdrive/c/%mypath%deregister_from_elb.sh'"

register_with_elb.batがどのように見えるか想像できます。

このソリューションは現在本番環境で機能しており、最大 6 か月間大きな問題はありません。

于 2016-07-13T07:39:26.210 に答える