Run grunt build command on Travis CI

前端 未结 4 1626
不思量自难忘°
不思量自难忘° 2021-01-30 20:29

I am using Travis CI to test and build my project and as part of it I want travis to run grunt build i have tried the following but have had no luck.

4条回答
  •  感情败类
    2021-01-30 21:32

    Make sure that you have grunt as part of your devDependencies. Here is a sample file: https://github.com/fraxedas/raspi-cloud/blob/master/package.json

    "devDependencies": {
      "grunt": "^0.4.5",
      "grunt-contrib-jshint": "^0.11.2",
      "grunt-contrib-watch": "^0.6.1"
    }
    

    Travis-ci will install grunt on the install step:

    npm install 
    ...
    grunt@0.4.5 node_modules/grunt
    ...
    

    In my case I wanted to run jshint with grunt. Here is my travis.yml file: https://github.com/fraxedas/raspi-cloud/blob/master/.travis.yml

    To integrate grunt all I needed was:

    before_script: grunt jshint
    

    You can change jshint by another command.

提交回复
热议问题