# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:11.13.0-alpine

pipelines:
  branches:
    test:
      - step:
          name: deployment
          deployment: test
          caches:
            - node
          script:
            - apk update
            - apk add --update alpine-sdk
            - apk add python
            - npm install -g serverless
            - npm install --save-dev serverless-prune-plugin
            - npm install
            - export AWS_REGION=us-west-1
            - serverless config credentials --verbose --stage test --provider aws --key ${AWS_ACCESS_KEY_ID} --secret ${AWS_SECRET_ACCESS_KEY}
            - sls create_domain --stage test
            - sls deploy --stage test
            # - serverless deploy --stage test
