I'm executing sample powershell scripts as part of deployment via CodeDeploy. Below is content of appsec.yml
version: 0.0
os: windows
files:
- source: \
destination: C:\Users\Administrator\testapp
hooks:
ApplicationStop:
- location: C:\Users\Administrator\testapp\stop.ps1
timeout: 300
BeforeInstall:
- location: C:\Users\Administrator\testapp\copy.ps1
timeout: 300
ApplicationStart:
- location: C:\Users\Administrator\testapp\start.ps1
timeout: 300
ValidateService:
- location: C:\Users\Administrator\testapp\validate.ps1
timeout: 300
But when I'm starting deployment with code deploy, getting below error:
Error code
ScriptMissing
Script name
C:\Users\Administrator\testapp\copy.ps1
Message
Script does not exist at specified location: C:/ProgramData/Amazon/CodeDeploy/85c23e0a-90f5-474e-9675-df3301a3b8f9/d-CODHEXCG5/deployment-archive/C:/Users/Administrator/testapp/copy.ps1
When I checked location C:/ProgramData/Amazon/CodeDeploy/85c23e0a-90f5-474e-9675-df3301a3b8f9/d-CODHEXCG5/deployment-archive, I see artifacts are downloaded from S3 buckets.
Artifacts directory structure:
+ deployment-archive
+ scripts
- copy.ps1
- stop.ps1
- start.ps1
- validate.ps1
- appsec.yml
I think files are not getting copied from Deployment Archive to destination I mentioned in appsec file. But why its not getting copied, not able to understand. Please guide
scripts, i.e., C:\Users\Administrator\testapp\scripts\stop.ps1`?