Posts

Showing posts with the label DevOps

Git commands cheat sheet

If you want to learn about Git I highly recommend Pro Git book, written by Scott Chacon and Ben Straub. Online version of the book is available here  https://git-scm.com/book/en/v2 Based on the Pro Git book the article here is a quick reference of the most common Git commands mentioned in the book. All content is licensed under the  Creative Commons Attribution Non Commercial Share Alike 3.0 license . Git Repository Initializing To add a directory that is currently not under version control to Git, go to that project’s directory and initialize. This creates a new subdirectory named .git that contains repository files. $ cd /u02/git/poc/myproj1 $ git init Cloning an Existing Repository If the repository exists and you want to set up on your laptop, easiest option is to clone the whole repository. There are options to clone a single branch if you want to. $ cd /u02/git/poc/ $ git clone https://github.com/ /myproj1.git This will create a directory call...

Upgrade the Jenkins running in a Docker container

If you are using Docker for running Jenkins CI server chances are you will get messages such as a "New version of Jenkins is available for download" Now if you want to upgrade your Jenkins server follow the steps below: 1. Login to your jenkins container docker container exec -u 0 -it jenkins bash 2. Change the directory to jenkins folder cd /usr/share/jenkins 3. Take a backup of your old jenkins.war file mv jenkins.war jenkins.war_bak 4. Download the latest version of jenkins wget http://updates.jenkins-ci.org/download/war/2.164.3/jenkins.war 5. Change permission of the file chown jenkins:jenkins jenkins.war 6. Exit the container and restart it exit docker container restart jenkins