• Blogs (9)
    • šŸ“± 236 - 992 - 3846

      šŸ“§ jxjwilliam@gmail.com

    • Version: ā€šŸš€ 1.1.0
  • Jenkins-CI and Travis-CI

    Blogs20152015-02-08


    1. Jenkins-CI

    Jenkins-CI is a powerful tool for continuous integration:

    • Building/testing software projects continuously. In a nutshell, Jenkins provides an easy-to-use so-called continuous integration system, making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. The automated, continuous build increases the productivity.
    • Monitoring executions of externally-run jobs, such as cron jobs and procmail jobs, even those that are run on a remote machine. For example, with cron, all you receive is regular e-mails that capture the output, and it is up to you to look at them diligently and notice when it broke. Jenkins keeps those outputs and makes it easy for you to notice when something is wrong.

    To install and run Jenkins is pretty easy, add/config new Items probably take some time, but it is worth in a team continuous integration and tests environment.

    //1. download Jenkins for Mac OS X
    
    //2. set http port=9090 for web-access:
    cd /Applications/Jenkins
    sudo vi winstone.properties: httpPort=9090
    //or:
    // sudo defaults write /Library/Preferences/org.jenkins-ci httpPort 9090
    
    //3. start Jenkins daemon:
    java -jar jenkins.war
    //or:
    // sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist
    // sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
    
    //4. go to url to configure the item:
    http://localhost:9090

    It will be better to add a user login page to validate before accessing Jenkins-UI. I wrote a simple AngularJS SPA page for this: http://jsfiddle.net/williamjxj/b6wzbqnb/embedded/

    2. Travis-CI integrated with github

    It is pretty easy to do so, because Travis-CI is a hosted continuous integration service which already integrated with GitHub and offers JavaScript supports. Every-time when push to github, the ā€˜Travis-CI’ will be triggered to do the syntax checking, and integrating tests, then send a notification email to you. So you know the push is a clean codes on github or not. Pretty cool.

    1. go to travis-ci.org to sign in.
      Note that on https://travis-ci.org, you’ll currently only see your public repositories; whereas on https://travis-ci.com, you can find your private projects.
    2. Activate GitHub Webhook
    3. Add .travis.yml file to your repository
      The following is a standard basic .travis.yml:
    language: node_js
    node_js:
      - "0.10"
    
    before_script:
      - export DISPLAY=:99.0
      - sh -e /etc/init.d/xvfb start
      - npm start < /dev/null &
      - npm run update-webdriver
      - sleep 1 # give server time to start
    
    script:
      - node_modules/.bin/karma start karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=Firefox
      - node_modules/.bin/protractor e2e-tests/protractor.conf.js  --browser=firefox