sudo: required 
language: c
services:
  - docker
before_install:
  - sudo docker pull opennmt/opennmt:latest
  - sudo docker build -t opennmt/opennmt:latest --cache-from opennmt/opennmt:latest .
  - sudo docker run -itd --name build -v $(pwd):/repo -w /repo opennmt/opennmt:latest
before_script:
  - export LUA=$(docker exec build which luajit lua | head -n 1)
script:
  - sudo docker exec build luacheck *lua /repo/onmt/ /repo/tools/ /repo/benchmark/ /repo/test/
  - sudo docker exec build luarocks make rocks/opennmt-scm-1.rockspec
  - sudo docker exec build ${LUA} -lluacov test/test.lua -e "${LUA} -lluacov"
  - sudo docker exec build luacov
after_success:
  - bash <(curl -s https://codecov.io/bash)
  - |
        if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
            docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
            sudo docker tag opennmt/opennmt:latest opennmt/opennmt:$TRAVIS_BUILD_NUMBER
            docker push opennmt/opennmt
        fi

sudo: required 
language: c
services:
  - docker
before_install:
  - sudo docker pull opennmt/opennmt:latest
  - sudo docker build -t opennmt/opennmt:latest --cache-from opennmt/opennmt:latest .
  - sudo docker run -itd --name build -v $(pwd):/repo -w /repo opennmt/opennmt:latest
before_script:
  - export LUA=$(docker exec build which luajit lua | head -n 1)
script:
  - sudo docker exec build luacheck *lua /repo/onmt/ /repo/tools/ /repo/benchmark/ /repo/test/
  - sudo docker exec build luarocks make rocks/opennmt-scm-1.rockspec
  - sudo docker exec build ${LUA} -lluacov test/test.lua -e "${LUA} -lluacov"
  - sudo docker exec build luacov
after_success:
  - bash <(curl -s https://codecov.io/bash)
  - |
        if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
            docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
            sudo docker tag opennmt/opennmt:latest opennmt/opennmt:$TRAVIS_BUILD_NUMBER
            docker push opennmt/opennmt
        fi

Fix Docker environment variable name
Fix Docker environment variable name
