image: node:10.15.3

pipelines:
  default:
    - step:
        name: Build and package
        script:
          - apt-get update && apt-get install -y zip
          - zip -r codeNodejs.zip *
        artifacts:
          - codeNodejs.zip
    - step:
        name: Update Lambda code
        script:
          - pipe: atlassian/aws-lambda-deploy:0.2.1
            variables:
              AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
              AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
              AWS_DEFAULT_REGION: 'us-east-2'
              FUNCTION_NAME: 'unityAuth'
              COMMAND: 'update'
              ZIP_FILE: 'codeNodejs.zip'