How to: Jenkins Auto Deploy & Slack-Jenkins integration

Automated deployment via Jenkins

If you are someone who is supposed to manage deployment on multiple environments or on clustered environment, you know how painful or time-consuming it can be manually. This post will enable you to automate deployment across multiple environments, from Jenkins branch of your choice.

Well there are few prerequisites before we start, read below:

  1. You have your shell script(s) ready on servers you are looking to deploy build
  2. ssh from your Jenkins server to target servers is enabled
  3. You will need a project in Jenkins which you can configure as Auto-Deployment project. Preferably copy of your existing project which you are currently using for so that you get most of the config copied
  4. Publish over SSH, Build Authorization Token Root Plugin, Slack Plugin plugins are installed in Jenkins(explained in Step- 2)

Step- 1

Create standard structure on each target server, e.g. /home/Autobuild or /u01/mydummyproject/Autobuild

Within Autobuild folder, keep your deployment script which Jenkins will be calling and also create one more directory within Autobuild folder named as build

Read more