Chuan Chuan Law

DevOps | Software Automation | Continuous Integration | Continuous Delivery

How To Write Jenkinsfile

Jenkinsfile is another great feature from Jenkins2. Below is an example of a Jenkinsfile: properties( [                 //Parameters of a Jenkins build   parameters( [ text(defaultValue: ”, description: ‘URL’, name: ‘ARTIFACT’), choice(choices: ‘qa’, description: ‘Deploy_Env’, name: ‘DEPLOY_ENV’), string(defaultValue: ‘master’ , description: ‘ Branch’,name:’BRANCH’) ] ) ] ) //Which node the […]

How To Install Tomcat8 On Ubuntu 14 Trusty By Extracting Package

Introduction Tomcat8 package is yet currently available for Ubuntu 14.04. However, we can set up Tomcat8.0.32 on Ubuntu 14.04 by using the package for Tomcat 16. A Tomcat8 package consists of the following packages: authbind libcommons-collections3-java libcommons-dhcp-java libcommons-pool-java libecj-java libtomcat8-java tomcat8 tomcat8-common Steps: Install Tomcat8.0.32 on a Ubuntu 16 box Inspect the contents of the […]

Consul – Alerts

Consul alerts comes really handy in order to notify you whenever the services that you are monitoring goes down. There are many channels that we could integrate. In this blog, I’ll be using HipChat. To set up: Install consul alerts /usr/local/go/bin/go get -u Set the HipChat keys. We could do this via : Key/Value on […]

Consul – Using Consul Backinator For Backup Purposes

We can use consul-backinator as Consul KV pair backup and restore tool. To implement this on the Consul Leader server: Prerequisite:  S3 repo for backup AWS CLI Steps: Download Go sudo curl -O Unarchive the tar file sudo tar -xvf go1.8.linux-amd64.tar.gz sudo mv go /usr/local Install consul-backinator sudo /usr/local/go/bin/go get -u Add consul-backinator to cron job sudo […]

How To Setup Consul On Ubuntu

Introduction Consul is a very lightweight and simple Dev Ops tool by Hashicorp  to enable monitoring of servers and services on it. It comprises of: A cluster – a group of servers acting as Consul managers. In this blog, we are setting up a cluster of 3 servers or managers. Agents – the servers that […]

How To Perform SonarQube Upgrade on Ubuntu

SonarQube is used as an integration with Jenkins to enable code quality analysis. Installation is pretty straightforward as discussed in the official documentation. In this blog, I would like to share  some “hipccups” that I encountered during server upgrade scenario. Setup PostgreSQL server This blog has pretty comprehensive notes on this 2. Backup the existing database using […]

Jenkins – Making Data Persistent In Docker Slave

As in Jenkins Docker Slave, every time a job runs, a new Docker container is started and terminated upon job completion. This will mean it will download all the dependencies every time. To avoid this, we will use the Volume function in Docker. As we are using the Docker Plugin, there is a field to […]

How To Set Up Jenkins 2.0 Master & Slaves On Docker

Jenkins 2.0 Master In Docker We can just use the Jenkins Docker official image, or you can just install Jenkins 2.0 normally.  Jenkins Slave In Docker Setup Install Docker Open up TCP port by adding the following in /etc/default/docker DOCKER_OPTS=”-H tcp:// -H unix:///var/run/docker.sock” On Jenkins Master, install Docker Plugin on Master->Manage Jenkins->Manage Plugins On Master->Manage Jenkins->Cloud configure […]

Docker – Using Tiller To Overwrite Environment Specific Variables

To use Tiller, in Dockerfile, we specify: ADD deploy/tiller/*.yaml /etc/tiller/ ADD deploy/tiller/environments/dev /etc/tiller/environments/ ADD deploy/tiller/templates/* /etc/tiller/templates/ Tiller folder comprises of the following: environments This is where the yaml for environment specific variables are written: #These are the variables to overwrite service.conf.erb template service.conf.erb: target: /etc/appleapi/application.ini config: environment_name: “prod” #These are the variables to overwrite template.conf.erb template […]

Docker – How To Run A Debian Package In Docker

Below are the major steps on how to run a Debian package in Docker Dockerfile Download your Debian file # Download .deb fileRUN wget $debian_url \ && sudo dpkg -i appleapi.deb \ && apt-get install -f Using Ruby Tiller to overwrite environment specific configs (optional) #Tiller RUN sudo apt-get update && sudo apt-get -y install ruby RUN gem […]

« Older posts

© 2017 Chuan Chuan Law

Theme by Anders NorenUp ↑