Front-end engineering --travis-ci

       For a series of operations eslint front end of the project, test, codecc, coverage, build, automatic deployment, operation when all git push one button buttoned, are flattered to think about it.

       Here is the introduction github repository + travis-ci complete the operation.

  1. Provide provide git repository on github
  2. github Login travis-ci's official website: https://travis-ci.org/ , associate git project
  3. Set Environment Variables

     

  4. New .travis.yml file repository root directory, as follows:

Language: node_js 
node_js:
     - '12 is' 
branches: 
  only:
     - master - will be constructed only after the master branch Push 
the install:
     - NPM the install 
Script:
     - NPM RUN Build 
after_script:
   - LS - A
   - RM - RF .git - If you need to push the entire directory to delete .git file, if the file directory dist build only push the cd ./dist on the line, you do not need to delete the .git file, otherwise the last sentence git push will not push on
   - LS - a
   - git the init
   - the user.name Git config "$ {GH_USER}" 
  - user.email Git config "$ {GH_EMAIL}" 
  - Git the Add.
   - Git the commit -m "111 the commit" 
  - Git Status
  - git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:dev

 

 5, the final push to build on the results of the current dev branch git repository.

Construction Phase:

before_install: Before install phase of implementation 
performed before script stage: before_script 
after_failure: When the script execution phase fails 
to perform when the script stage success: after_success 
before_deploy: deploy performed before step 
after_deploy: deploy executed after step 
execution after the script stage: after_script

 

Extended:

Build the document only to demonstrate, the product was constructed dev branch to push example, if additional test, lint and other operations,

Directly increase npm run test before npm run build; npm run lint; script

 

Guess you like

Origin www.cnblogs.com/hehedaa/p/11547264.html