Kickstart your career with best deals on top training courses NY10 Click to Copy

Search

How To Configure Jenkins With BITBUCKET - Cloud Computing

PURPOSE:This article will provide you a complete detailed knowledge of configuring Jenkins with Bitbucket repository which will help in automating the deployment process and will help to set the path for the interaction of Jenkins continuous integration tool with bitbucket repository.INTRODUCTION:As a part of the continuous integration and deployment process, it is a requirement that the code repository should have an interaction with the build automation and continuous integration tool. In this article, we are working with bitbucket and Jenkins to achieve the same, but this could be similar to the other tools that are available in the market. Let’s see the steps to integrate a Bitbucket with the Jenkins.Ways for Enabling Jenkins with Bitbucket:STEP 1: Login to your Jenkins and then select Manage Jenkins->Plugin Manager and on the tab available select the option bitbucket plugin and click on install without restart. In my case, this is installed already hence it’s showing under the Installed section.Step 2: Once the installation is done, configure a sample project and in build triggers section during the creation of a new project select build when a change is pushed to bitbucket and click apply and save to enable trigger Jenkins with bitbucket:Step 3: Now, visit Bitbucket URL: https://bitbucket.org/ and create your own repository, if you haven’t created yet else visit your own bitbucket repository for the purpose of this course. I have LearnShareKnowledge as the repository-Step 4: Click on the clone and copy the repository URL which you want to configure with Jenkins from bitbucket:Step 5: Go back to Jenkins and click on the project which you have to create and click on configure under the Source Code Management section, select the repository type which you have in your bitbucket repository. In my case, it is git and paste the URL by removing git clone to connect Jenkins with bitbucket. Click on save to reflect the changes:Step 6: Select the credentials if it is not a public repository for configuring the credentials, you can click the Add button on credentials section and proceed with username and password under global credentials domain and click Add.Step 7: Now, again visit the bitbucket repository which you want to configure. For that, click on settings under that repository:Step 8: Under settings, click on webhooks highlighted in the picture:Step 9: Click on add webhook and give the title to that webhook and paste the URL of Jenkins which you have configured with bitbucket and then select active and repository push and save the changes. If you want to make this more secure, then you can verify this with SSL certificate but in my case,  I used a secure key which provides a security to this setup:Now with the Jenkins setup for Bitbucket, we are ready to test the complete configuration. As soon as you do commit to the repository, you will be having an automated build triggered initiating a job inside the Jenkins project which you have configured with the repository.
Rated 4.0/5 based on 3 customer reviews

How To Configure Jenkins With BITBUCKET - Cloud Computing

611
  • by Rohan Singh
  • 03rd Oct, 2018
  • Last updated on 19th Feb, 2019
  • 3 mins read
How To Configure Jenkins With BITBUCKET - Cloud Computing

PURPOSE:

This article will provide you a complete detailed knowledge of configuring Jenkins with Bitbucket repository which will help in automating the deployment process and will help to set the path for the interaction of Jenkins continuous integration tool with bitbucket repository.

INTRODUCTION:

As a part of the continuous integration and deployment process, it is a requirement that the code repository should have an interaction with the build automation and continuous integration tool. In this article, we are working with bitbucket and Jenkins to achieve the same, but this could be similar to the other tools that are available in the market. Let’s see the steps to integrate a Bitbucket with the Jenkins.

Ways for Enabling Jenkins with Bitbucket:

STEP 1: Login to your Jenkins and then select Manage Jenkins->Plugin Manager and on the tab available select the option bitbucket plugin and click on install without restart. In my case, this is installed already hence it’s showing under the Installed section.

Step 2: Once the installation is done, configure a sample project and in build triggers section during the creation of a new project select build when a change is pushed to bitbucket and click apply and save to enable trigger Jenkins with bitbucket:

Step 3: Now, visit Bitbucket URL: https://bitbucket.org/ and create your own repository, if you haven’t created yet else visit your own bitbucket repository for the purpose of this course. I have LearnShareKnowledge as the repository-


Step 4: Click on the clone and copy the repository URL which you want to configure with Jenkins from bitbucket:

Step 5: Go back to Jenkins and click on the project which you have to create and click on configure under the Source Code Management section, select the repository type which you have in your bitbucket repository. In my case, it is git and paste the URL by removing git clone to connect Jenkins with bitbucket. Click on save to reflect the changes:

Step 6: Select the credentials if it is not a public repository for configuring the credentials, you can click the Add button on credentials section and proceed with username and password under global credentials domain and click Add.

Step 7: Now, again visit the bitbucket repository which you want to configure. For that, click on settings under that repository:


Step 8: Under settings, click on webhooks highlighted in the picture:


Step 9: Click on add webhook and give the title to that webhook and paste the URL of Jenkins which you have configured with bitbucket and then select active and repository push and save the changes. If you want to make this more secure, then you can verify this with SSL certificate but in my case,  I used a secure key which provides a security to this setup:

Now with the Jenkins setup for Bitbucket, we are ready to test the complete configuration. As soon as you do commit to the repository, you will be having an automated build triggered initiating a job inside the Jenkins project which you have configured with the repository.

Rohan

Rohan Singh

Blog Author

Rohan Singh is the Devops Engineer Manager and Solution Architect at healthcare product based MNC, he is a technical blogger who shares technical related issues based on real life experiences to motivate IT professionals in putting their efforts for the betterment of  Devops and solution architect field

Join the Discussion

Your email address will not be published. Required fields are marked *

Suggested Blogs

Team Collaboration: The Benefits Of Using Cloud Tools

According to Forbes Insights: Collaboration in the Cloud,the ability to mingle across geographical parameters, time zones, or even organizational borders is becoming an ever more critical foundation of success. The cloud has reached a place where it has become an integral part of our everyday work-lives. Based on its affordability and colossal effectiveness, modern entrepreneurs are using cloud services to build and run their small businesses, while working with people from different parts of the globe. In fact, collaborative work based on cloud technology has already proved its competency in bringing your most diverse teams together. By working together on on-site and off-site documents alike, cloud collaboration tools allow your team members to ingress, edit and even share files outside of the company firewall. Thanks to the growing practices of BYOD (Bring Your Own Device) and remote employment, cloud tools are fast becoming permanent features of the contemporary workplace. Modern-day workforce wants to move and communicate easily between various devices and cloud collaboration helps them to do that. Perks Of The Cloud Despite the increasing trend of cloud collaboration to amplify business productivity, many small businesses are yet to understand its benefits. According to the report published by Endurance International Group, many entrepreneurial ventures fail to take advantage of the significant advances in cloud collaboration technology and are also “unfamiliar with some of the most advantageous online tools.” The study also found that even though one-third of the respondents had heard of the term, they were unsure of what cloud computing actually meant. While 11 percent of the group said they rely on cloud collaboration for their business functioning,  67 percent of people admitted to not having invested in the technology yet. As a business person, if you too are thinking of investing in cloud tools for collaboration, here are the five basic benefits of the practice for start-ups and their teams. Easy Deployment & Maintenance SaaS (software as a service) collaborative solutions, often requiring little more than a license activation to get you up and running, are easy to install and maintain – with no unnecessary software downloads or costly, time-consuming hardware installations. Often by simply entering an email address, you can test a cloud-based collaboration product with a free trial. By taking advantage of free trials, you can be more confident when it comes time to purchase. Cost Effective Many of the cloud collaboration perks are linked to its cost-effectiveness. Unlike the age-old, on premise software, you don’t have to invest in pricey infrastructure with cloud-based collaborative tools. They also eradicate the need for expensive customization and heavy IT involvement. Following the pay-as-you-go model, cloud collaboration is indeed a cost effective solution for tech-businesses. The computer billing method, under this utility, only requires you to pay for procured, rather than actual computer resources. This means, instead of paying for an entire infrastructure in the case of in-house IT department, you only have to pay for the services used in a given month. Since cloud-based collaboration allows employees to work from remote locations, you can actually cut off office overheads, making it especially beneficial for entrepreneurial ventures that usually have a strict work budget. After subtracting the upfront and extensive capital expense, you can also mitigate project risk by using cloud technology to your advantage. Everything is web-based, which means no time-consuming installation, system configuration or maintenance involved either. Thus, as a part of tech-service industry, you don’t have to bother about constant updates or server upkeep. Boosts The Project Management Process The ability to connect people to share information when it’s most needed is one of the key advantages of cloud collaboration tools. Besides, it helps businesses streamline the documentation process by keeping all project related files within the same workspace, allowing them to manage everything in a single domain; the cloud. With these collaborative project management tools, you can retain archived versions of all your information and update them in real time. Additionally, your team members can add tasks and comments to each file, providing you with a detailed audit trail of all project related interactions. You can even create and manage task lists, making your overall project management much faster and simpler. According to a 2014 Software Advice study, thousands of interviewed buyers, shopping for the right project management tool, revealed that around 46% of small business consumers were using manual methods like email, pens, papers and Excel. But companies that have a cloud-based deployment preference voted for cloud solutions over on-site disposal. And the biggest chunk, around 98% of them looked for project management as one of the integrated services in their cloud collaboration tools. The challenging aspect of projecting across various stand-alone platforms makes the reason behind such preferences quite obvious. Nonetheless, the key is to find a collaborative tool that helps you create and manage milestones and goals seamlessly to keep your project on track. Syncing Files & Data By hosting the on-going project documents, shareable records, presentations and more in the cloud, your files are automatically synced and available from any of your devices. Without any additional action required to access the file, a presentation can be uploaded from your work computer and further presented from your tablet at home. You can also easily share documents with your co-workers without the need to remain in the same office. Greater Scalability Cloud based technologies are famously known for their flexibility and scalability. Using a cloud-based collaboration tool, you can start small and add on the resources as the demand increases. It is often the case for start-ups that the number of participants and the volume of contributions increase rapidly in-between projects. Under cloud collaboration, it becomes easier to cater to such growing demands without adding much cost. The most important benefit of cloud tools is they allow you to scale for users, workload and adoption. You can, therefore, accommodate the growth seamlessly. Without making any infrastructure investment, you only have to pay for additional storage and users as you need them. Additionally, you can manage peaks in demand by automatically allocating managing team performance and capacity when facing data-intensive periods. This helps you achieve greater organizational agility. In Conclusion The outlook of cloud collaboration is such that it serves companies and the mobile workforce with multiple locations and allows remote workers to access information seamlessly across devices, helping them to become more productive at work. Upon understanding the real benefits of cloud collaboration, you will also realise that its goal is to provide a natural working experience with your team members, even when that’s not the case.      
Rated 4.0/5 based on 20 customer reviews
Team Collaboration: The Benefits Of Using Cloud To...

According to Forbes Insights: Collaboration in the... Read More

SSHing into Ubuntu EC2 instance post blocking port 22 with UFW - Cloud Computing

IntroductionThis blog is in reference to a troubleshooting situation in Amazon Web Services when you have configured firewall setting in your ubuntu ec2 or remote instance and is not able to login via PuTTY through SSH as the instance. Here, we will see how to insert SSH into the instance in a certain situation when you are logged out of that instance.During configuration of SSL security, we may accidentally or purposely block SSH for the instance to make the instance secure. But, what if we again want the same instance to SSH for certain changes.  Below is the highlighted configuration of the instance. Here, you can see that all the instances have all ports opened to everything.Here are the configuration changes which you have made on the login into instance:$ sudo apt-get update $ sudo apt-get install nginx $ sudo apt-get install ufw  Check UFW Status and Rules At any time, you can check the status of UFW with this command:$ sudo ufw status verbose By default, UFW will be disabled so you should see something like this:Output: Status: inactive If UFW is active, the output will say that it's active, and it will list the rules that are set. For example, if the firewall is set to allow SSH (port 22) connections from anywhere, the output might look something like this:Output: Status: active Logging: on (low) Default: deny (incoming), allow (outgoing), disabled (routed) New profiles: skip To                         Action      From --                         ------      ---- 22/tcp                     ALLOW IN Anywhere $ sudo ufw deny ssh $ sudo ufw status verbose Output: Status: active Logging: on (low) Default: deny (incoming), allow (outgoing), disabled (routed) New profiles: skip To                         Action      From --                         ------      ---- 22/tcp                     DENY    Anywhere If you kicked or logged out of the instance once the changes are done, you will be seeing the below results.On SSH into the instance with your Public DNS through PuTTY below are the results which you are seeing as an error i.e. Network error: Connection Timed Out  Below error shows that even after all ports were opened outside, the instance is not able to SSH because of firewall software of Ubuntu at the system level. Let’s see how to resolve this kind of system related issue.Solution to the issue:Step 1: Take an image of the EC2 instance by selecting the instance ->Image-Create ImageStep 2: Provide specification Image name, tick on no reboot and push the create image buttonStep 3: Then Select the image and click on launchStep 4: Go to instance type, select and click on NextStep 5: In the configuration instance, write the below commands under Advanced Details and click on next:#!/bin/bash sudo ufw allow ssh sudo ufw allow 22 sudo ufw allow 443 sudo ufw allow 8080 sudo ufw allow 80 sudo ufw status  sudo ufw enable Step 6: Click next and next tab and add security group similar as providedStep 7: Review and launch the instance and then try to SSH to the instance through PuTTY. You will be now able to add SSH inside the instance with this and you can terminate the old instance as the new instance with all the setup same as that of the old instance without any issue except the public IP and private IP change.Best Practices of Firewall Configuration & Port Blocking:Ensure that the Security Groups will allow a specific IP addresses which are within the VPN Range of the Environment.Use of NACL for allowing and blocking the IP addresses or subnets for a specific Port by using allow and deny rules. A network ACL contains a numbered list of rules that we evaluate in order, starting with the lowest numbered rule. This helps to determine whether traffic is allowed in or out of any subnet associated with the network ACL. The highest number that you can use for a rule is 32766. We recommend that you start by creating rules in increments (for example, increments of 10 or 100) so that you can insert new rules.Use of Bastion Host for accessing critical servers and environment is always a better option to increase the security of the system or environment. 
Rated 4.0/5 based on 3 customer reviews
SSHing into Ubuntu EC2 instance post blocking port...

IntroductionThis blog is in reference to a trouble... Read More

How To Save Up To 40% On Azure Bill Without Buying Any Cost Management Software

I have seen many projects get shut down because of the Azure usage cost. Being a senior developer, I was asked to look over the azure usage and optimize the usage to reduce cost. In this article, we will discuss various ways for effective Azure cloud architecture cost optimization that can easily save up to 40% on Azure cost without purchasing any Cost Management Software. I'll also share some deep insights, which IT Managers doesn't care about, and which has a huge impact on Azure Bill.Different cost management system:1.CloudynCloudyn is an Azure cost management software that provides features like Report on cost and usage, Categorize by resource tags, Create and manage cost and usage budgets, Create alerts on cost and usage budgets, Eliminate idle cloud resources, Right-size cloud resources, Chargeback features including cost markup, redistribution, and custom charges, Customize recommendation thresholds and Categorize costs with custom meta-tags2. ProXcioProXcio contains features like cost analytics, usage analytics, filtered table views, exec dashboards, best practice reports, tag-based analytics, tag-based budgeting, budget analytics, aggregated reporting, limits data stored, limit range for analytics, CSV data import, EA Account drill down, multi-users support, no credit card required, support, cost forecasting, e-mail alerts, data export, Reports scheduling, API access, azure list price invoicing3. RackNapRackNap contains features like White-Label Marketplace, Subscription Billing, Support Helpdesk, Customer Self-service Portal, CRM, Sales and Marketing, Business Intelligence, Own Catalog Management, Partner Management, Inventory Management, Core Customizations, 3rd Party Integrations, Online Training, Admin Users, Deployment Countries, Deployment Model, Services for Launch.4. Azure CostsAll Azure Plans (incl. EA), Unlimited data retention Includes all Professional Features, Multi-Contract & User Support, Team & Enterprise Support, Subscription Based Permissions, Branding & Customizable Widgets, Azure Active Directory Support, Data Access via RESTful APIPrice Comparison:The table below compares the prices of different Azure cost management software available:Review Azure usage and costsCost Analysis Vs Cost AllocationDrill into various data segments itemized from the billing file using Cost Analysis Reports. The reports enable granular cost navigation across Azure raw billing data.After you create a cost model, Cost Allocation reports are available. It matches the data to the usage and tag data of the Azure Account.Cost Over Time:Cost Over Time report displays spends over time to allow you to observe trends and detect irregularities in your deployment. It includes main cost contributors such including ongoing costs and one-time RI fees are being spent during a selected time frame.Use Actual Cost Over Time to see cost trends over time and find irregularities in costAmortized Cost:Amortized cost is that accumulated portion of the recorded cost of a fixed asset that has been charged to expense through either depreciation or amortization. Amortized Cost Reports shows non-usage-based service fees or one-time payable costs and spread their cost over time evenly during their lifespan. For example, one-time fees might include:Reserved Instances purchase feesAzure Marketplace itemsAnnual security component feesThis report displays the main cost contributors within a specified time range and includes ongoing usage costs and one-time RI fees, amortized over the term of the asset or reservation.Custom Charges:Enterprise and CSP often provide additional services to their customers along with their own cloud consumption. You can define these customs charges for added service and additional discounts if any. The list of customs charges doesn't show the different rates that you may be charging.5 things to consider saving to save costIf you are using a public cloud like Azure, it is crucial to know the ways to save cost as your bill is based on consumption. Below are the 5 tips explained to lower Azure pricing and optimize hosting costs:1. Select Azure Reserved VM instancesWhat is RI (Reserved Instance)?An Azure Reserved Virtual Machine Instance (RI) is a virtual machine (VM) on the Microsoft Azure public cloud that has been reserved for dedicated use on a one- or three-year basis.RIs require a one-time, upfront payment and offer customers a discount of up to 72% when compared to Microsoft's standard on-demand, pay-per-use VM pricing model.Azure shows 3 options for Discount -Pay as you go -  You only need to pay for how much you will use.1 year reserved (~29% savings) – 29% discount will be given for reserving VMs for 1-year use.3 years reserved (~43% savings) --43% discount will be given for reserving VMs for 1-year use.2. Compare cost before choosing datacenter regionThe different VM pricing tiers do vary in price from region to region.https://azure.microsoft.com/en-in/pricing/calculator/It combines the pricing data for all VM instance sizes across all Azure regions.Estimate your expected monthly bill using our Pricing Calculator and track your actual account usage and bill at any time using the billing portal. Set up automatic email billing alerts to be notified if your spend goes above an amount you configure.3. Make use of Azure Hybrid BenefitThe most cost-effective cloud for your Windows Server or SQL Server migration which helps you-Save up to 80% on Windows Server with Azure Hybrid Benefit and Reserved InstancesSave up to 55%1 on migrations to Azure SQL Database2 with Azure Hybrid BenefitGo at your own pace - move a few workloads or entire data centers)Maximise your investment in Microsoft Server SoftwareNow is the time to move to Azure and reap the rewards of cloud technology, including the ability to scale up or down quickly, pay only for what you use and save on compute power. Whether you are deploying new virtual machines, moving a few workloads or migrating your data centers as part of your hybrid cloud strategy, the Azure Hybrid Benefit provides big savings as you move to the cloud.4.  Use different load calculator to identify the required loadThere are few additional Database resources whose price cannot be calculated based on days and storage. It needs to specify throughput, DTU, and many additional add-ons.Two types of calculators for databases-1) SQL Database Calculatorhttps://dtucalculator.azurewebsites.net/If you are a developer using SQL Server, you've probably heard of Azure SQL Database and you've probably been thinking about migrating your on-premise or VM-based SQL Server database(s) to Azure SQL Database. If so, you've probably asked yourself, "which service tier and performance level should I use and how many database throughput units (DTUs) am I using now?" This calculator will help you determine the number of DTUs for your existing SQL Server database(s) as well as a recommendation of the minimum performance level and service tier that you need before you migrate to Azure SQL Database. Knowing the minimum service tier will allow you to get the performance you need while minimizing your costs.2) Cosmos Db Calculatorhttps://www.documentdb.com/capacityplannerTo help customers fine-tune their Azure Cosmos DB throughput estimations, there is a web-based tool to help estimate the request unit requirements for typical operations, including document creates, reads, and deletes.5. Make use of BYOL (Bring Your Own License)What is BYOLBYOL, or “bring your own license,” is the process you can use to deploy software that you already have a license. When you BYOL, you are responsible for managing your own licenses. You are responsible for managing true-ups and renewals as required under your Volume Licensing agreement. In addition, you must submit a new verification form when you renew your agreement and when you deploy any previously unverified products.How to go for BYOL?As a customer using License Mobility through Software Assurance, you must complete a license verification process. Microsoft will verify the eligible license with active Software Assurance and send a confirmation once the verification process is completed.Azure now have to Bring Your Own License (BYOL) images of Windows Server and Windows 10 directly in the marketplace.This is what you needed to do before:Install Windows 10 or Windows Server on an On-Premise machineSysprep the installationUpload the vhd to a storage accountCreate a VM (by template or script) using the custom imageThis is what you need to do now to achieve the same thing:Create a VM (by template or script) using the new marketplace BYOL imageHope you found this article helpful to reduce and optimize your Azure costs. Understand and manage your Azure spend effectively with the help of above 5 cost optimization strategies for Azure bill.
Rated 4.0/5 based on 2 customer reviews
How To Save Up To 40% On Azure Bill Without Buying...

I have seen many projects get shut down because of... Read More