image: atlassian/default-image:2

pipelines:
  branches:
    master:
      - step:
          script:
            - apt-get update
            - apt-get install -y zip
            - zip -r application1.zip .
            - pipe: atlassian/aws-code-deploy:0.2.5
              variables:
                DEBUG: 'TRUE'
                AWS_DEFAULT_REGION: $QA_AWS_DEFAULT_REGION
                AWS_ACCESS_KEY_ID: $QA_AWS_ACCESS_KEY_ID
                AWS_SECRET_ACCESS_KEY: $QA_AWS_SECRET_ACCESS_KEY
                APPLICATION_NAME: $QA_APPLICATION_NAME
                S3_BUCKET: $QA_S3_BUCKET
                COMMAND: 'upload'
                ZIP_FILE: 'application1.zip'
                VERSION_LABEL: 'my-app-1.0.0'
            - pipe: atlassian/aws-code-deploy:0.2.5
              variables:
                DEBUG: 'TRUE'
                AWS_DEFAULT_REGION: $QA_AWS_DEFAULT_REGION
                AWS_ACCESS_KEY_ID: $QA_AWS_ACCESS_KEY_ID
                AWS_SECRET_ACCESS_KEY: $QA_AWS_SECRET_ACCESS_KEY
                APPLICATION_NAME: $QA_APPLICATION_NAME
                DEPLOYMENT_GROUP: $QA_DEPLOYMENT_GROUP_NAME
                S3_BUCKET: $QA_S3_BUCKET
                COMMAND: 'deploy'
                WAIT: 'true'
                VERSION_LABEL: 'my-app-1.0.0'
                IGNORE_APPLICATION_STOP_FAILURES: 'true'
                FILE_EXISTS_BEHAVIOR: 'OVERWRITE'
