Posts

Showing posts with the label scripts

Colour formatting - Jenkins Console

Image
Jenkins is the main CI tool used in Software industry. This is the backbone tool for all CI and CD implementation, Build - release and deployment methods. With the help of 100s of plugin available around the jenkins, We can achieve so much of automation around build process including build/deployment pipeline, notification, analysis, pre and post build action etc. Jenkins has tremendous power to perform great amount of work around the core build process. Many time we write script in pre and post build action to perform many tasks which is becoming very command and necessary for automation. But the main limitation in running shell script is that it's very difficult to make it more human readable for errors and make it fancy. Today i am going to cover some steps to make the output of shell script colour formatted. Jenkins Configuration Steps First install following jenkins plugin https://wiki.jenkins-ci.org/display/JENKINS/AnsiColor+Plugin Go to jenkins configurati...

Manage Docker images on local disk

Docker is very powerful containerization technique, and it is becoming famous in short time. People are adapting and containerizing their applications for deployment. Soon container become very heavy and consume too much of disk space, If you do not delete old images and layers you may soon run out of disk space. Here i am trying to cover the ways to regain the disk space consumed by docker images. Moving docker filesystem to bigger mount point. Usually docker keeps all temporary files related to image building and layers at /var/lib/docker This path is local to the system usually at root partition "/" . You can mount a bigger disk space and move the content of /var/lib/docker to the new mount location and make sym link.  This way even docker images occupy space, will not affect  your system as it will be using some other mount location. Remove Old docker images Here are few ways to remove old and unused docker images Removing stopped contai...

Sample gradle file

Following details are part of previous blog http://www.scmtechblog.net/2015/12/how-to-migrate-parent-pom-from-maven-to.html Here is the sample of base gradle file which can be acted as super pom for your project. There are 2 profiles we have enabled whitebox-analysis and Coverage-analysis which does complete checks and only jacoco respectively.

Logrotate setup

How to setup logrotate There are several applications which do not have in build capability to rotate the logs and purge the old logs. Lets take example of apache, You may need to rotate its log and purge old one and zip the current one. It's not possible to truncate the apache log when its running, You will need to handle in via logotate command. Here is the way you can setup logrotate for an application. Here I am taking example of apache, You can change it as per your need

Access Restriction for User in SVN

Controlling User access in Subversion User can be restricted in SVN for the repo/branch etc via pre-commit scripts But that restriction will be only for check in (commit). What if you want to restrict user from reading or checkout your repo/directory/branch. If you have some sensitive information in your repo(Or any other reason) which can only be accessed by set of users, Here is your solution to restrict read access to repo. In your apache conf file you need to add following configuration.    AuthzSVNAccessFile  /etc/apache2/conf/authz.conf

SVN Tag and Branch Lock

Locking SVN Tag Every branch, tag is a directory in SVN. You have to(can) manipulate the directories as per your requirement. SVN does not provide any in built feature to lock any branch directory (branch, tag). Here is the script to lock the tags in svn #tag_lock.sh #!/bin/sh

Few Pre commit SVN scripts and tricks

SVN hook scripts Today I would like to talk about some SVN pre-commit hooks scripts and customizations. SVN comes with feature of precommit hook script which can be used to control commit and put tab on the basis of multiple requirements. Here are few very common needed features in form of scripts. Binary file check