# This is an appspec.yml template file for use with an EC2/On-Premises deployment in CodeDeploy.
# https://docs.aws.amazon.com/codedeploy/latest/userguide/app-spec-ref.html
version: 0.0

os: linux 

files:
  - source: /
    destination: /app
    overwrite: true

permissions:
  - object: /
    pattern: "**"
    owner: ubuntu
    group: ubuntu

hooks:
  BeforeInstall:
    - location: scripts/install.sh
      timeout: 300
      runas: ubuntu
  AfterInstall:
    - location: scripts/post_install.sh
      timeout: 600
      runas: ubuntu
  ApplicationStart:
    - location: scripts/run.sh
      timeout: 120
      runas: ubuntu
  ApplicationStop:
    - location: scripts/stop.sh
      timeout: 120
      runas: ubuntu
  # ValidateService:
  #   - location: scripts/validate.sh
  #     timeout: 60
  #     runas: ubuntu


# hooks:

#   BeforeInstall:
#     - location: scripts/before_install.sh
#       timeout: 300
#       runas: root

#   AfterInstall:
#       - location: scripts/after_install.sh
#         timeout: 1000
#         runas: root

#   ApplicationStart:
#     - location: scripts/start_server.sh     
#       timeout: 300
#       runas: root