Canarys | IT Services

Blogs

DevOps with Visual Studio Team Services for Java

,
Share

Java DevOps is simply applying DevOps practices and philosophies to Java app development. That means that compartmentalized teams are no longer needed when creating Java applications.

Benefits of Java DevOps

  1. DevOps take a people-first approach. Apart from bringing together your development, operations and other teams, DevOps require team members to understand the perspective of other members of the team. That may mean a developer is sharing his or her concerns with the team and a SysOp doing the same. This kind of understanding can enable team members to help each other, such as a developer building facilities and tools that another team member needs. As such, collaboration is not only encouraged by necessity. But even as you bring teams together, it also puts focus on accountability and ownership.
  2. Java DevOps cuts the time to develop a Java application. This will help you deliver the right Java applications to end users faster, and even become more efficient as time wears on. You can also adapt faster to every changing market conditions and demands.
  3. Better application quality. DevOps almost always require a shift to continuous integration, which means that every step of the application’s development is tested and monitored. Each change is also tested. It is because of this that Java DevOps can ensure that your Java applications have a positive experience for your users. Plus, DevOps can Increase security, rather than hinder it.
  4. You don’t get overwhelmed. You can manage and operate your applications, processes, and infrastructure at scale

Before working on below Exercise you must have Azure account if you don’t have account, create one now.

Simply click the link to deploy to azure and all resources will be deployed to resource group. You can delete the resource group in order to remove all the created resources at any time.

  • Creating a VSTS account and Team Project

You will need a Visual Studio Team Services (VSTS) account – if you do not have one, you can create one now.

create a new project- link to create project.

  • Importing MySHuttle2 code from GitHub into VSTS.

In this task, you will import code from a GitHub repo into VSTS.

  1. Enter the following url: https://github.com/nwcadence/MyShuttle2.git and click Import.-If you do not know here is the link.

import-myshuttle2-ur...

  • Importing the MyShuttleCalc code from Github into VSTS.

In this task you will import the MyShuttleCalc code from Github into VSTS.

  1. Enter the following url: https://github.com/nwcadence/MyShuttleCalc.git and click Import.

import-myshuttlecalc...

  • Set up a Private Docker VSTS Build Agent.
  1. In this you are going to configure a private build agent that runs in a Docker container.To setup Agent we require PAT, here is the link to generate the PAT
  2. When the token is created you will have to copy it – this is your only chance to see the token. Copy it from the browser into the clipboard. And Save it.
  • Starting a VSTS Agent Container using Docker.

In this task you will start a VSTS build agent container using Docker. This container will be used to run builds and releases

  1. Enter a command in terminal.
docker run -e VSTS_ACCOUNT=<account> -e VSTS_TOKEN=<pat> -e DOCKER_CERT_PATH=/root/.docker -v /var/run/docker.sock:/var/run/docker.sock --name vstsagent -it vsts/agent.
  • Connect to VSTS from IntelliJ.
  1. Open the IntelliJ, Under the plugin section install Visual Studio Team Services.

2. When IntelliJ restarts, the Welcome dialog will appear again. Click “Check out from Version Control” and                   select “Team Services Git”.

3. Click on “sign in..” to sig in VSTS account.

intellij-vsts-signin

  • Clone MyShuttle2 from VSTS with IntelliJ.
  1. Once you have authenticated, enter “MyShuttle2” into the search bar and select the MyShuttle2 repo from your team project. Click the Clone button to clone the repo to the VM.

intellij-select-repo

2. IntelliJ detects a Maven project file (pom.xml) and Configure the SDK.

intellij-select-sdk

3. In Similar way clone MyShuttleCalc From VSTS with IntelliJ.

  • Maven Package Management with VSTS

Here, you are going to set up package management with Maven in VSTS. This repo contains a class library (MyShuttleCalc) that is used by the MyShuttle2 application.

  1. Create Maven Package Feed -If you do not know here is the Link to create.
  2. In VSTS, go back to the Connect to Feed dialog on your Maven feed. Click on the copy button in the section labeled Add this feed to your project pom.xml inside the <repositories> tag.

maven-packagefeed-se...

3. In your editor, open the pom.xml file. Update the <repositories> tag as well as the <distributionManagement> tag so that they point to your feed.

Leave a Reply

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

Reach Us

With Canarys,
Let’s Plan. Grow. Strive. Succeed.