0% found this document useful (0 votes)
23 views

Devops Unit 5

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Devops Unit 5

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

lOMoARcPSD|44294957

Devops Unit-5

Devops (Anna University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by riya maalini ([email protected])
lOMoARcPSD|44294957

Github Account Creation


What is Github?
GitHub is a code hosting platform for collaboration and
version control.
GitHub lets you and others work together on projects from
anywhere.
Github is owned by Microsoft, provides access to public(free)
and private(paid) repositories.
Steps to create Github Account:
Step 1: Go to https://github.com/join in a web browser.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Step 2: Enter your personal details. In addition to creating a


username and entering an email address, you'll also have to
create a password. Your password must be at least 15
characters in length or at least 8 characters with at least one
number and lowercase letter.

Step 3: Click Verify to start the verification puzzle. The


instructions vary by puzzle, so just follow the on-screen
instructions to confirm that you are a human. A green
checkmark will appear after completing the puzzle.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Step 4: Click the green Create account button. It's below


the form, at the bottom of the page. This will take you to an
email verification page.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Carefully review the Terms of Service at


https://help.github.com/en/articles/github-terms-of-service
and the Privacy Statement at
https://help.github.com/en/articles/github-privacy-statement
before you continue..

Step 5: Verify your email by entering the code. After


clicking Create account, you’ll receive an email with a code.
Enter this code on the verification page. Entering the code
will automatically take you to the welcome page.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Step 6: Select your preferences and click Continue. GitHub


displays a quick survey that can help you tailor your
experience to match what you're looking for. You’ll be sent to
the plan selection page after completing the survey.

Step 7: Note the types of plans offered by GitHub. There are a


few different plans to choose from, varying in the amount of
features provided.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Step 8: Select the free plan. On the plan selection page, scroll
down to click the button for choosing a free plan. This will
immediately take you to your GitHub dashboard.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

 If you choose a paid plan, you'll have to enter your


payment information as requested before you can
continue.
 If you want to upgrade your Github account in the future,
click the menu at the top-right corner, select Settings, and
choose Billing and plans to view your options.

GitHub essentials are:


 Repositories
 Branches
 Commits
 Pull Requests
 Git (the version control software GitHub is built on)

Repository:

A GitHub repository can be used to store a development


project.
It can contain folders and any type of files (HTML, CSS,
JavaScript, Documents, Data, Images).
A GitHub repository should also include a licence file and a
README file about the project.
A GitHub repository can also be used to store ideas, or any
resources that you want to share.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Github Repository Creation

Step 1: Click on the new repository option

Step 2: After clicking new repository option, we will have to


initialize some things like, naming our project, choosing the
visibility etc. After performing these steps click Create
Repository button.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Step 3: After clicking the button, we will be directed to


below page. Right now the only file we have is a readme file.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Step 4: Now click on the “Upload files” button.

Step 5:Follow the steps mentioned and click “commit


changes”.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Step 6: Now you will see that all of our files uploaded in our
github.

Branch:
 A GitHub branch is used to work with different versions
of a repository at the same time.
 By default a repository has a master branch (a
production branch).
 Any other branch is a copy of the master branch (as it
was at a point in time).
 New Branches are for bug fixes and feature work
separate from the master branch. When changes are
ready, they can be merged into the master branch. If you
make changes to the master branch while working on a
new branch, these updates can be pulled in.

Commits:
At GitHub, changes are called commits.
Each commit (change) has a description explaining why a
change was made.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Pull Requests :
 Pull Requests are the heart of GitHub collaboration.
 With a pull request you are proposing that your changes
should be merged (pulled in) with the master.
 Pull requests show content differences, changes,
additions, and subtractions in colors (green and red).
 As soon as you have a commit, you can open a pull
request and start a discussion, even before the code is
finished.

Git:
 Git was created by Linus Torvalds in 2005 to develop
Linux Kernel
 Git is an open-source distributed version control
system. It is designed to handle minor to major projects
with high speed and efficiency.
 It is developed to co-ordinate the work among the
developers. The version control allows us to track and
work together with our team members at the same
workspace.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

CREATE AZURE ORGANIZATION


AZURE:

 Microsoft Azure, often referred to as Azure


 cloud computing platform run by Microsoft. It offers access, management,
and the development of applications and services through global data
centers

 It also provides a range of capabilities,


including software as a service (SaaS), platform as a service (PaaS), and
infrastructure as a service (IaaS).

 It was officially launched as Windows Azure in February 2010 and later


renamed Microsoft Azure on March 25, 2014

 Microsoft Azure supports many programming languages, tools,


and frameworks, including Microsoft-specific and third-party
software and systems.

Organization:

All organizations must be manually created via the web portal. We don't support
automated creation of

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

organizations. We do support automated organization configuration, project


creation, and resource provisioning via REST API.

Prerequisites:

 To plan your organizational structure.


 Microsoft accounts or authenticate users with
Microsoft Entra ID. For more information,
see Choosing your organization administrator account type.

Create an organization:
1. Sign in to Azure DevOps.

2. Select New
organi

z
ation.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

3. Confirm information, and then select Continue

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Congratulations, you're an organization owner!

Sign in to your organization at any


time, https://dev.azure.com/{yourorganization}.

With your organization, the following aspects are included in the


free tier:

First five users free (Basic license):


 Azure Pipelines:
o One Microsoft-hosted CI/CD (one concurrent job, up
to 30 hours per month)
o One self-hosted CI/CD concurrent job
 Azure Boards:
 Work item tracking and Kanban boards
 Azure Repos:

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

 Unlimited private Git repos


 Azure Artifacts:
 Two GiB free per organization

Build applications with Azure:


 Azure DevOps enables you to build, test, and deploy any
application to any cloud or on premises
 To configure build pipelines that continuously build,
test, and verify your applications.

Part 1: Get started with Azure DevOps

Part 2: Build applications with Azure DevOps

Part 3: Deploy applications with Azure DevOps

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

In this learning path, you will get started on your


DevOps :
 See how value stream maps can help you evaluate your
current processes and technologies
 Sign up for your free Azure DevOps organization
 Learn how to plan and track work items using Azure
Boards
 Optimize sprint workloads across multiple Agile teams

Create a build pipeline with Azure Pipelines:

Prerequisites:
 Familiarity with forking and cloning a GitHub repo
Account requirements:
 An Azure DevOps organization
o To use Microsoft-hosted agents, your Azure DevOps
organization must have access to Microsoft- hosted
parallel jobs. Check your parallel jobs and request a
free grant.
o You can use GitHub Codespaces to complete the
module, even if your Azure DevOps organization
doesn't have any parallel jobs.
 A GitHub account

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Software requirements:
 If using GitHub Codespaces to complete the module,
there are no software requirements as all software is
included in the Codespace

 If using a local development environment with


Microsoft-hosted agents,
 you must have the following software installed:
o Visual Studio Code
o .NET 6.0 SDK
o Git

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Create a pipeline in azure


What is pipeline
Azure Pipelines supports continuous integration (CI)
and continuous delivery (CD) to continuously test,
build, and deploy your code. You accomplish this by
defining a pipeline.
The latest way to build pipelines is with the
YAML pipeline editor. You can also use Classic
pipelines with the Classic editor.

Create your first pipeline

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

 This is a step-by-step guide to using Azure


Pipelines to build a sample application from a
Git repository. This guide uses YAML
pipelines configured with the YAML pipeline
editor.
 If you'd like to use Classic pipelines instead, see
Define your Classic pipeline. For guidance on
using TFVC, see Build TFVC repositories.
Prerequisites - Azure DevOps
 A GitHub account where you can create a
repository.
 An Azure DevOps organization. Create one
for free. If your team already has one, then
make sure you're an administrator of the
Azure DevOps project that you want to use.

Get the Java sample code


To get started, fork the following repository into
your GitHub account.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

https://github.com/MicrosoftDocs/pipelines-java
Create your first Java pipeline
1. Sign-in to your Azure DevOps organization and go to your project.

2. Go to Pipelines, and then select New pipeline.

3. Do the steps of the wizard by first selecting GitHub as the location of


your source code.

4.You might be redirected to GitHub to sign in. If so, enter your


GitHub credentials.

5.When you see the list of repositories, select your repository.

6.You might be redirected to GitHub to install the Azure Pipelines app. If so,
select Approve & install.

7.Azure Pipelines will analyze your repository and recommend the Maven
pipeline template.

8.When your new pipeline appears, take a look at the YAML to see what it
does. When you're ready, select Save and run.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

9.You're prompted to commit a new azure pipelines.yml file to your


repository. After you're happy with the message, select Save and run again.

 If you want to watch your pipeline in action, select the build job.

 You just created and ran a pipeline that we automatically created for you,
because your code appeared to be a good match for the Maven template.

 You now have a working YAML pipeline (azure-pipelines.yml) in


your repository that's ready for you to customize!

10. When you're ready to make changes to your pipeline, select it in the
Pipelines page, and then Edit the azure-pipelines.yml file.

View and manage your pipelines


You can view and manage your pipelines by choosing
Pipelines from the left-hand menu to go to the
pipelines landing page.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

From the pipelines landing page you can view pipelines


and pipeline runs, create and import pipelines, manage
security, and drill down into pipeline and run details.

Choose Recent to view recently run pipelines (the default


view), or choose All to view all pipelines.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Select a pipeline to manage that pipeline and view the runs. Select the build
number for the last run to view the results of that build, select the branch name to
view the branch for that run, or select the context menu to run the pipeline and
perform other management actions.

Select Runs to view all pipeline runs. You can


optionally filter the displayed runs.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Select a pipeline run to view information about that run.

You can choose to Retain or Delete a run from the context menu. For more information on run
retention, see Build and release retention policies.

View pipeline details


The details page for a pipeline allows you to view and manage that pipeline.
Choose Edit to edit your pipeline. For more information, see YAML pipeline editor. You can also edit
your pipeline by modifying the azure-pipelines.yml file directly in the repository that hosts the

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

pipeline.

Choose Edit to edit your pipeline. For more information, see YAML pipeline editor.
You can also edit your pipeline by modifying the azure-pipelines.yml file directly
in the repository that hosts the pipeline.
View pipeline run details
From the pipeline run summary you can view the status of your run, both while it
is running and when it is complete.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

From the summary pane you can view job and stage details, download artifacts, and
navigate to linked commits, test results, and work Items From the summary pane you
can view job and stage details, download artifacts, and navigate to linked commits, test
results, and work items

Jobs and stages


The jobs pane displays an overview of the status of your stages and jobs. This pane
may have multiple tabs depending on whether your pipeline has stages and jobs, or
just jobs. In this example, the pipeline has two stages named Build and Deploy. You
can drill down into the pipeline steps by choosing the job from either the Stages or
Jobs pane.

Choose a job to see the steps for that jobFrom the

steps view, you can review the status and details of eachstep. From the More
actions you can toggle timestamps or view a raw log of all steps in the
pipeline.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Cancel and re-run a pipeline


If the pipeline is running, you can cancel it by choosing Cancel. If the run
has completed, you can re-run the pipeline by choosing Run new .

Pipeline run more actions menu:


From the More actions menu you can download logs, add tags, edit the
pipeline, delete the run, and configure retention for the run .

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Add a status badge to your repository


Many developers like to show that they're keeping their code quality high
by displaying a status badge in their repo.

To copy the status badge to your clipboard:


1. In Azure Pipelines, go to the Pipelines page to view the list of pipelines.
Select the pipeline you created in the previous section.

2. Select , and then select Status badge.

3. Select Status badge.

4. Copy the sample Markdown from the Sample markdown section.

Now with the badge Markdown in your clipboard, take the following steps in
GitHub:

1. Go to the list of files and select Readme.md. Select the pencil icon to edit.

2. Paste the status badge Markdown at the beginning of the file.

3. Commit the change to the main branch.

4.Notice that the status badge appears in the description of your repository.

To configure anonymous access to badges for private projects:

1. Navigate to Project Settings in the bottom left corner of the page

2. Open the Settings tab under Pipelines

3. Toggle the Disable anonymous access to badges slider under General

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Azure-Pipeline

• Azure Pipelines provides a YAML pipeline editor that


you can use to author and edit your pipelines.

• The YAML editor is based on the Monaco Editor.


• The editor provides tools like Intellisense support and
a task assistant to provide guidance while you edit a
pipeline.

• You can also edit pipelines by modifying the


azurepipelines.yml file directly in your pipeline's repository
using a text editor of your choice

Edit a YAML pipeline


To access the YAML pipeline editor, do the following steps.

• Sign in to your organization

• (https://dev.azure.com/{yourorganization}).

• Select your project, choose Pipelines, and then


select the pipeline you want to edit. You can browse
pipelines by Recent, All, and Runs.

• Choose Edit.

• Make edits to your pipeline using Intellisense and the task assistant for
guidance.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

• The YAML pipeline editor provides several keyboard


shortcuts, which we show in the following examples.
• Choose Ctrl+Space for Intellisense support while you're
editing the YAML pipeline.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

• The task assistant provides a method for adding tasks


to your YAML pipeline.
• To display the task assistant, edit your
YAML pipeline and choose Show assistant.

Understand the azure-pipelines.yml file


• A pipeline is defined using a YAML file in your repo.
Usually, this file is named azure-pipelines.yml and is
located at the root of your repo.
• Navigate to the Pipelines page in Azure Pipelines,
select the pipeline you created, and choose Edit in
the context menu of the pipeline to open the YAML
editor for the pipeline.
• This pipeline runs whenever your team pushes a change
to the main branch of your repo or creates a pull request.
It runs on a Microsoft-hosted Linux machine.
• The pipeline process has a single step, which
is to run the Maven task.

YAML:Code

trigger:
- main

strategy:
matrix:
jdk10_linux:
imageName: "ubuntu-latest"
jdkVersion: "1.10"
jdk11_windows:
imageName: "windows-latest"
jdkVersion: "1.11"
maxParallel: 2

pool:
vmImage: $(imageName)

steps:
- task: Maven@4
inputs:
mavenPomFile: "pom.xml"

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

mavenOptions: "-Xmx3072m"

javaHomeOption: "JDKVersion"
jdkVersionOption: $(jdkVersion)
jdkArchitectureOption: "x64"
publishJUnitResults: true
testResultsFiles: "**/TEST-*.xml"
goals: "package"

Change the platform to build

• Navigate to the editor for your pipeline by selecting


Edit pipeline action on the build, or by selecting
Edit from the pipeline's main page.
• To choose a different platform like Windows or Mac, change the
vmImage value:
• pool:
• vmImage: "windows-latest" Add steps
• You can add more scripts or tasks as steps to your
pipeline. A task is a pre-packaged script. You can use
tasks for building, testing, publishing, or deploying
your app. For Java, the
Maven task we used handles testing and publishing results,
however, you can use a task to publish code coverage results
too.

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

• Open the YAML editor for your pipeline.


• Add the following snippet to the end of your YAML file.

Buildusingmultipleversions

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Build using multiple versions

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Downloaded by riya maalini ([email protected])


lOMoARcPSD|44294957

Downloaded by riya maalini ([email protected])

You might also like