使用travis时如何解决构建超时

时间:2019-06-15 04:39:50

标签: docker travis-ci

我正在设置travis,以在运行测试脚本后将图像推送到docker hub

sudo: required
services:
  - docker
before_install:
  - docker build -t oskygh/react-test -f ./client/Dockerfile.dev ./client
script:
  - docker run oskygh/react-test npm test -- --coverage
after_success:
  - docker build -t osbee/client ./client
  - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_ID" --password-stdin
  - docker push osbee/client

dockerfile.dev

FROM node:alpine
WORKDIR '/app'
COPY ./package.json ./
RUN npm install
COPY . .
CMD ["npm","run","start"]

1 个答案:

答案 0 :(得分:0)

here所述,您可以使用travis_wait函数。将其添加到命令之前,该命令失败。您还可以阅读此stackoverflow,它以另一种方式添加。