简体   繁体   中英

Travis CI build is not starting

I am trying to learn the tool Travis CI, and thus I made a react project which is run inside a docker container. I have pushed the code on git-hub with all the necessary files. Even after making the.travis.yml file with no errors, after pushing the code, Travis is not triggering the build of the app.

Below is the code repository structure:

my code repo

This is code of the file Dockerfile.dev:

 FROM node:alpine WORKDIR /app COPY package.json. RUN npm install RUN chmod -R a+rwx node_modules COPY. . CMD ["npm","run","start"]

This the code in.travis.yml file:

 sudo: required services: - docker before_install: - docker build -t mydockerreact -f Dockerfile.dev. script: - docker run mydockerreact npm run test

I have tried almost everything in this file but the build is not triggering on the CI tool

You have to login to travis with you GitHub account and activate your repository first before pushing the travis.yml file. check here

And add language to your travis.yml if no language is specified travis will think it's ruby project and gives 'No Gemfile found, skipping bundle install' error. So if u don't want to add any language you can use generic

language: generic
services: 
  - docker    

before_install: 
  - docker build -t mydockerreact -f Dockerfile.dev .

script:
  - docker run mydockerreact npm run test

After some research I found out that I was using travis-ci.org and that's why it wasn't building it. I switched to travis-ci.com and it worked absolutely fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM