Giter Site home page Giter Site logo

jenkins-php's Introduction

Jenkins

This Jenkins can be run in a container of a host by mounting the docker.sock

Included PHP tools

Included Plugins

  • checkstyle
  • cloverphp
  • crap4j
  • dry
  • email-ext
  • git-client
  • git
  • github-api
  • github
  • greenballs
  • htmlpublisher
  • jdepend
  • plot
  • pmd
  • postbuild-task
  • postbuildscript
  • scm-api
  • slack
  • violations
  • warnings
  • xunit

Build Image

plugins.txt list the plugins you want to installed in Jenkins.

docker build -t myjenkins .

Run Image

docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker -v /home/ubuntu/jenkins_home:/var/jenkins_home -p 8080:8080 myjenkins

or

docker run -d -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker -v /home/ubuntu/jenkins_home:/var/jenkins_home -v /home/ubuntu/work:/work -p 8080:8080 --name jenkins myjenkins

Jenkins Job Configuration

  • On the configuration page, click “Add build step” then “Execute shell”.
sudo docker run [Docker Image]
  • Console Output will show the result.

Github and Jenkins

Install Github API plugin and Github plugin.
Reference: plugins.txt

Github webhook

  • Githup repo > Settings > Webhooks & Services > Services > Add service
  • choose Jenkins (GitHub plugin)
  • Jenkins hook url: http://<you jenkins url>:8080/github-webhook/

Jenkins Job Configuration

  • source code management > git

    • input Repository URL
    • Additional Behaviours > Check out to a sub-directory
      for example: $BUILD_NUMBER
      Jenkins will clone source code into $BuildId_NUMBER folder.
  • check Build when a change is pushed to GitHub

  • Add build step > Execute shell
    for example: Mount $BUILD_NUMBER to docker container.

    sudo docker run -v /home/ubuntu/jenkins_home/workspace/docker-test/$BUILD_NUMBER:/test test
    

Issue

  • Security: Jenkins user has root access to the host

jenkins-php's People

Contributors

c9s avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.