joefitzgerald / packer-windows

Windows Packer Templates
MIT License
1.63k stars 1.12k forks source link

Packer(version1.3.2) running from AWS CodeBuild, Stops abruptly while execution PS script #271

Open yakashy opened 5 years ago

yakashy commented 5 years ago

Hi,

I am using AWS CodeBuild to run packer for creating AMI (windows). I have multiple PS scripts under provisioner. when I one of PS script is triggered it stops abruptly approx after 30 sec and after some time next PS script gets invoked. The script which gets stuck has a while loop which needs to check the status from EventLogs of application deployment on the server (custom windows service will does application deployment and update the status in event logs). And as per the status, it will exit. However, it does not reach until that stage and stops.

Log Snippet: [1;32m==> amazon-ebs: Provisioning with Powershell...·[0m ·[1;32m==> amazon-ebs: Provisioning with powershell script: ./so-core/scripts/CheckEventLog.ps1·[0m ·[0;32m amazon-ebs: Thread Started 0·[0m ·[0;32m amazon-ebs: Thread Started 1·[0m ·[0;32m amazon-ebs: Thread Started 2·[0m ·[1;32m==> amazon-ebs: Provisioning with Powershell...·[0m

As you can see after 3 iterations it stops and after some time next PS script is called/executed.

The question here is:

  1. Do we have any time setting for how long a script can execute?
  2. Any insight about such behavior, or how can I debug this further?

Thanks