version: 0.2
       
env:
  parameter-store:
    LOGIN_USERID: "docker-userid"
    LOGIN_PASSWORD: "docker-password"
    BUILD_JOBS: "docker-build-jobs"
    AWS_KEY: "symbols-aws-key"
    AWS_SECRET: "symbols-aws-secret"

phases:
  install:
    runtime-versions:
      docker: 18
  pre_build:
    commands:
      - echo Logging into Docker Hub...
      - docker login -u $LOGIN_USERID -p $LOGIN_PASSWORD
  build:
    commands:
      - echo Start building latest evt-mainnet...
      - cd Docker/mainnet && docker build -t everitoken/evt-mainnet:latest --build-arg bjobs=$BUILD_JOBS --build-arg awskey="$AWS_KEY" --build-arg awssecret="$AWS_SECRET" .
  post_build:
    commands:
      - echo Publish to Docker Hub...
      - docker push everitoken/evt-mainnet:latest
