Thursday, January 12, 2017

Continuous Deployment Automation : Git -> Jenkins -> Docker

DevOps - continuous deployment automation using Git, Jenkins & Docker


Create a Git repository ->


Create a Dockerfile (- to build a container for a php web application shown above in video as an example) inside the Git repository ->


Create other components (index.php under src folder in above example) in the git repository needed to run the designated application inside a docker container -> Change one of these components to git commit the change and trigger a Jenkins build ->


Create a Jenkins freestyle project in Jenkins -> Update the above created Git repository location under SCM configuration of the project -> Select trigger builds remotely and input an authorization token in the configuration ->


Update .git/hooks/post-commit file with a syntax to trigger the Jenkins job created in above step -> Update .git/hooks/post-commit file with a syntax to execute docker commands to create and run a docker container using a Dockerfile ->


Docker commands can be put in an executable file (buildExecutable in this case) ->


Commit the change made (-in one of above steps) in application component -> post-commit of .git/hooks folder will trigger the Jenkins build job -> post-commit will also execute docker commands to build and run a docker container running an application within (a php web application in this case).


2 comments:

  1. hi Abhay,
    this is rahul here. i checked your blog and its are really very awesome. i am new to this can you please share me some docs or videos how you have created job in jenkin please if you can share me brief about it. it will be great help for me. Thanks in advance

    ReplyDelete
  2. Hi Rahul,

    Please use this blog to create a free style job in Jenkins

    http://solutionframework.blogspot.my/2016/12/devops-continuous-integration-eclipse.html

    Please use this blog to create a maven build job in Jenkins

    http://solutionframework.blogspot.my/2017/01/devops-ci-eclipse-selenium-git-jenkins.html

    ReplyDelete