Preparing Jenkins for first Job

Add SSH site

You need to configure one ssh site in

Manage Jenkins > Ssh remote hosts > Add

Generate SSH keys

You must generate a ssh-key to avoid use ssh-credentials.
In your server, open a console and execute.

ssh-keygen

Press Enter till you get the prompt.

ssh-copy-id -i user@ip_address

(It will once ask for the password of the host system)

ssh user@ipaddress

Now you should be able to login without any password.

Enable others SSH encryption algorithms

If your server uses Ubuntu 15.04 or highest you must add the next line in

/etc/ssh/sshd_config

KexAlgorithms diffie-hellman-group1-sha1,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1

And then restart the ssh.

sudo /etc/init.d/ssh restart

Install extensions

The simplest way is by going to your installation's management screen and clicking Manage Plugins and go to the Available tab. You'll find the plugin you'd like to install, select the checkbox, and then either attempt to Install without restart or Download now and install after restart. The web interface will then download *.hpi files from here. If you Install without restart the interface will show you progress and provide the results of the install.

Sometimes when you install, you will notice that the list of available plugins is empty. If that is the case, from Advanced tab on the Manage Plugins page, click on Check now (button available in the bottom right of the page) to forcefully check for new updates. Once that is done, you should see the list of plugins.

Required extensions

SSH Plugin
EnvInject Plugin
Team Foundation Server Plugin
Slack Plugin

Restart Jenkins manually

To restart Jenkins manually, you can use either of the following commands:

(jenkins_url)/safeRestart

Allows all running jobs to complete. New jobs will remain in the queue to run after the restart is complete.

(jenkins_url)/restart

Forces a restart without waiting for builds to complete.

Global Environment Variables

Jenkins allow us to configure some global environment variables to use it in all our Jobs. You'll find it in:

Manage Jenkins > Global properties

Check "Environment variables" and add one.

Slack Plugin

The Slack plugin allows for configuring a default Slack channel, or a Slack channel may be defined on a per build task basis.

This integration will post build notifications to a channel in Slack. Click on Apps & integrations on the Slack's main menu.

Slack's application directory will open on your browser. We look for Jenkins CI and click "install".

We start setting up Jenkins on Slack:

The settings screen will show up all the necessary information to configure Jenkins, including the access token.

  1. In your Jenkins dashboard, click on Manage Jenkins from the left navigation.

  2. Click on Manage Plugins and search for Slack in the Available tab. Click the checkbox and install the plugin.

  3. After it's installed, click on Manage Jenkins again in the left navigation, and then go to Configure System. Find the Global Slack Notifier Settings section and add the Slack values: The other fields are optional. See the help text by clicking the question mark icon next to the fields for more information. Press the Save button when you're done.

  4. For each Project that you would like receive notifications for, choose Configure from the project's menu.

  5. Add Slack Notifications to the Post-build Actions for this project. In the Slack Notifications section, choose the events you'd like to be notified about.

  6. Result:

results matching ""

    No results matching ""