Reputation: 1
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 :
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
Upvotes: 0
Views: 408
Reputation: 1
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.
Upvotes: 0
Reputation: 25
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
Upvotes: 1