Articles

In this article, we will discuss the automation of application deployment on a web server using Jenkins Pipeline. We will use Jenkins Pipeline as a script. Jenkins Pipeline as script can be of two types: declarative type and scripted type. Here, we will use declarative Jenkins Pipeline script.

Prerequisite Knowledge

  • Git, GitHub
  • Building Java applications using Maven
  • Jenkins
  • Web server like Tomcat, JBoss, etc.

If you are new to Jenkins Pipeline script, then we would recommend you to go through this article first.

Source de l’article sur DZONE

Though I have worked on Java for more than a decade, I have not had a chance to work on Groovy. While working for API Integration into Jenkins CI/CD pipeline, I extensively used Groovy to invoke REST API, validate the user input parameters, and business logic for that. After that, I found that Groovy is a fascinating program language for Java developers.

Why Is Groovy Easy for Java Developers?

It allows to use the Java syntax liberally and tries to be as natural as possible for Java developers. It is an object-oriented dynamic programming language for Java virtual machine (JVM) and can be integrated smoothly with any Java Program. The groovy syntax is lucid, familiar, and direct that makes to develop projects faster and easier. It demands a shorter learning curve for Java Developer to develop, test, and integrate to make production-ready code in a short span.

Source de l’article sur DZONE

Connect all your Git secrets to the Jenkins pipeline.

It’s a common practice to encrypt the secrets/credentials we use in our code and then save it in some secure place. We have a number of options to achieve this, with tools like Vault, Git-crypt, and more. However, git-secret is one simple awesome tool that we can use to store our secrets in our Git repo. Git secret uses gpg for encryption and decryption of secrets. 

Here’s how git-secret works. Go to the folder in your repo in which you have files to encrypt. Then, run git init && git secret init. This would initialize your .gitsecret folder. Then you run git secret tell $email , and if you want other users to decrypt the secrets file you have to import their gpg public key and again run git secret tell $otheruseremailid . Now you can run git secret add $secretfilename and git secret hide,which creates $yoursecretfile.secret file, which is an encrypted secret file.

Source de l’article sur DZONE