Git Product home page Git Product logo

practice_jenkins_build's Introduction

practice_jenkins_build

practice trigger project build on jenkins with github

Practice Steps

  • github → jenkins
    • Flow : commit code to github → jenkins build → return build result to github
    • Git project : https://github.com/alexho0205/practice_jenkins_build
    • Steps
      1. create personal token on github ( settings → developer settings )
      2. add github server on jenkins ( system → github servers )
        1. put personal token to credential ( credential type = secret text )
      3. create ssh-key pair
      4. put public key on github ( profile → settings → ssh and GPG keys → add ssh keys )
      5. put private key on jenkins ( credentials → add credentials → ssh with private key )
      6. add webhook on github (
        1. url → ${jenkins_url}/github-webhoook/
        2. content type → json
      7. create free-style job (jenkins)
      8. trigger jenkins to build project : commit code directly (github)
      9. check build result on github : repo -> commits -> green check (綠色小勾勾)
    • Bug Fix
      • 如果 jenkins 是全新的,第一次連線 github.com 前,需要加入 host key
        • ( linux )ssh 登入到 jenkins ,切換身份到 jenkins

          # 切換身份
          $ sudo su jenkins
          # 連線github.com,請自行變更 repo 位置
          # 連線後,linux 發現沒有 github.com 的 host key
          # 尋問是否加入 -> YES
          $ git ls-remote -h -- [email protected]:alexho0205/practice_jenkins_build.git HEAD
      • jenkins 需要外部IP,可使用ngrok

practice_jenkins_build's People

Contributors

alexho0205 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.