Skip to main content

Posts

Token replacement in Jenkins

Hi Folks, Today we are configuring our Jenkins to replace tokens in code before deployment. Please follow below steps. Create Project in git ( github  or any other git providing tool) Create a project which will contains all token values. in my case here is  public demo project . Deploy it in Jenkins as freestyle project , select git in Source Code Management and paste your git repository URL. If it is public then you don't need credentials to enter otherwise you have to. Build your project and check console output. Copy directory structure ( ref: below console snapshot). This is the physical directory structure of our deployed code in Jenkins hosted docker/OS. Configure project (in which token need to be changed) Create build.xml in your project root and past below code <project name="demo-app-tokenparser" default="useregex" basedir="."> <target name="useregex"> <property file="/var/jenkins_home/works

Deploy php Application into docker using Jenkins

Hi Folks, In my previouspost we have configured Jenkins docker with Docker-Outside-Of-Docker approach. Today we will be creating docker from php application and deploying through Jenkins as sibling to Jenkins docker. Below are the detail steps Configure PHP code I will be using yii2 application which will help those who want to deploy other php framework applications. ·          Create a file with name: Dockerfile on your project root. Paste below contents in the file created FROM webdevops/php-apache-dev COPY . /app RUN apt-get update COPY ./config/vhost.conf /opt/docker/etc/httpd/vhost.conf COPY ./config/10-server.conf /opt/docker/etc/httpd/conf.d RUN chmod 777 /app/runtime RUN chmod 777 /app/web/assets             ·          Create a folder with name : config on your project root. ·          Create a file with name: vhost.conf inside config folder. Paste below contents in the file created ####################################### # Vhost ##

Configure Jenkins (Docker-Outside-Of-Docker)

Hi Folks, Today I will teach you how to configure Jenkins  docker  container  inside Ubuntu 16.04. so lets dig into, happy learning Q:  what is Docker-Outside-Of-Docker? Ans:  This approach allows you to run any Docker container in your Jenkins build script. This image creates Docker sibling containers rather than children which would be created if Docker-In-Docker (dind) was used. Some advantages of dood over dind: enables sharing of images with host OS eliminates storing images multiple times makes it possible for Jenkins to automate local image creation eliminate the need for supervisord (which means multiple processes) eliminates a virtualization layer (lxc) allows greater flexibility at runtime permits the jenkins (sudo)user to run docker without the sudo prefix Reference (only text copied, we are not pulling the created docker)  Access your Ubuntu via ssh or open desktop version (if you are using locally) Install Docker Damon, Execute below commands  

Popular posts from this blog