ASP.Net Web Application Continuous Integration (CI) using Jenkins automation server: Creating & Adding SSH key to Bitbucket
In this blog post, we will see what all steps are involved in creating & adding SSH key to Bitbucket.
Note: You are currently on Part III of this series, do refer below parts for more details.
Part II: Starting & setting up Jenkins
Part IV: Creating Jobs In Jenkins: Getting source code from Bitbucket hosted git repository, polling the SCM to check whether changes were made, restore Nuget packages, build project using MSBuild, publish and archive the build
A. Creating SSH key
I. Set up your identity
Open git bash, enter ssh-keygen
Enter file in which to save the key
Enter and re-enter a passphrase when prompted.
II. Add the key to the ssh-agent
To start the agent, run the following:
$ eval $(ssh-agent)
Enter ssh-add followed by the path to the private key file
I have copied the generated public & private keys to “I:\Jenkins\tools\sshkeys” from “C:\Users\<username>”.
$ ssh-add I:/Jenkins/tools/sshkeys/bitbucketssh
B. Adding SSH key to Bitbucket
I. Login to Bitbucket and go to “Bitbucket Settings” page
II. On “Settings” page, click “SSH keys” under “Security” to go to “SSH keys” page.
III. On “SSH keys” page, click “Add key”, to open “Add SSH key” dialog.
On “Add SSH key” dialog, paste the content of public key (bitbucketssh.pub) to the “Key” textbox & click “Add key”.
Previous: Starting & setting up Jenkins
Next: Creating Jobs In Jenkins: Getting source code from Bitbucket hosted git repository, polling the SCM to check whether changes were made, restore Nuget packages, build project using MSBuild, publish and archive the build
.NET Professional | Microsoft Certified Professional | DZone’s Most Valuable Blogger | Web Developer | Author | Blogger
Doctorate in Computer Science and Engineering
Microsoft Certified Professional (MCP) with over 12+ years of software industry experience including development, implementation & deployment of applications in the .NET framework
Experienced and skilled Agile Developer with a strong record of excellent teamwork, successful coding & project management. Specialises in problem identification and proposal of alternative solutions. Provided knowledge and individual mentoring to team members as needed
Among top 3% overall in terms of contribution on Stack Overflow (~2.3 million people reached my posts). Part of the top 1% Stack Overflow answerers in ASP.NET technology.
DZone’s Most Valuable Blogger (MVB)
Created and actively maintain the TechCartNow.com tech blog while also editing, writing, and researching topics for publication.
Excellent skills in Application Development using C#/Vb.Net, .NET Framework, ASP.NET, MVC, ADO.NET, WCF, WPF, Web API, SQL Server, jQuery, Angular, React, BackboneJS