How to run batch files using CodeDeploy appspec file hooks on windows ec2 instance?

0

I am trying to run batch files to stop/start console apps within a windows ec2 instance upon deployment using CodeDeploy. For testing, I wrote a batch script to run a program that produces a simple text file. This batch script is listed under the ApplicationStart hook of my appspec.yml file. For some reason the text file is not being produced. My assumption is that the script isn't being run. Not sure on how to resolve this issue.

appspec.yml:

version: 0.0
os: windows
files:
  - source: /
    destination: /source/app
hooks:
  ApplicationStart:
    - location: .\application_start.bat 
      timeout: 300

application_start.bat

START C:\source\app\ConsoleApp1\bin\Release\ConsoleApp1.exe

I checked the script after deploying it and was able to run it manually just fine. What might I be missing?

  • I am also running through the free tier version of the ec2 and code deploy. Could this have caused an impact on the batch files not running?

질문됨 일 년 전602회 조회
1개 답변
0

Here's a link to the CodeDeploy's Windows Deployment tutorial: https://docs.aws.amazon.com/codedeploy/latest/userguide/tutorials-windows.html

AWS
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠