Giter VIP home page Giter VIP logo

tgif_xld's Introduction

Devoteam XL-Deploy/XL-Release KISS

This session will go through the basics of XL-Deploy and XL-Release. We'll use a Tomcat server to deploy the application. XL-Deploy, XL-Release and Tomcat are installed on a Alpine Linux VM using VirtualBox.

1. Pre-requisites

That's it! :) You can use a SSH Terminal like Putty to login to the VM, if you prefer it over using VirtualBox itself.

2. Architecture

alt text

Alpine hosts all applications used in this session. Tomcat is installed on the VM, while XL-Deploy and XL-Release are available as docker containers(with data persistence on the VM). The VM is available as an appliance you can import in your VirtualBox. The appliance also takes care of the port mapping, so you can access the applications using "localhost:<portNumber>"

3. Getting Started

Import VM as Appliance

Follow these instructions to import the VM as an appliance(*.ova).

Credentials

  • VM
    • User: root
    • Password: devoteam2019
  • XL-Deploy/XL-Release:
    • User: admin
    • Password: devoteam2019

URLs

*The "Docker Ip" is used to connect the containers and Tomcat over the network.

4. Start VM and its applications

  1. Start the VM with VirtualBox
  2. Login to the VM using VirtualBox or a SSH Terminal (Check the Credentials chapter above for username and password)
  3. Execute the following command to get the CONTAINER IDs to start XL-Deploy and XL-Release in the next step:
    docker ps -a
    alt text
  4. Start both containers using the following command:
    docker start <containerId>
  5. The applications should become available in a minute or two.

5. Let's do it!

Before we start, it's important to know that each entry in XL-Deploy is known as a Configuration Item or CI. So each defined application, application version, environment, host, etc is a CI.

XL-Deploy: First Deployment

We going to the following:

  1. Import the PetClinic application to deploy
  2. Define the Tomcat infrastructure
  3. Define an environment we can deploy to
  4. First Deployment of PetClinic
  5. Rollback a version of PetClinic
Import PetClinic

Import the PetClinic application, so you can deploy it later.

  1. Login to XL-Deploy
  2. Click on the ... next to Applications, then go to Import > From XL Deploy Server
  3. Select PetClinic-war/1.0 and click Import
  4. Repeat steps 2 and 3 for package PetClinic-war/2.0
  5. You should be able to see this:
    alt text
Infrastructure

We need to define the Tomcat infrastructure, so XL-Deploy knows where to deploy the PetClinic application.
We'll start by defining the target host first:

  1. Click on the ... next to Infrastructure, then go to New > overthere > SshHost
  2. Fill in the following:
    • Name: TomcatHost
    • Operating system: Unix
    • Connection Type: SCP
    • Address: 172.17.0.1
    • Port: 22
    • Username: root
    • Password: devoteam2019
  3. Click on Save and close
  4. Click on the ... next to TomcatHost, then go to Check connection
  5. Click on Execute to verify the connection to the Tomcat host. If verification is successful, click on Finish

Now we're going to define the Tomcat instance, so XL-Deploy knows where the Tomcat is installed on the target host.

  1. Click on the ... next to TomcatHost, then go to New > tomcat > Server
  2. Fill in the following:
    • Name: TomcatInstance
    • Home: /usr/local/tomcat/apache-tomcat-9.0.17
    • Start Command: /usr/local/tomcat/apache-tomcat-9.0.17/bin/startup.sh
    • Stop Command: /usr/local/tomcat/apache-tomcat-9.0.17/bin/shutdown.sh
  3. Click on Save and close

Last step in the infrastructure is to define where PetClinic needs to be deployed.

  1. Click on the ... next to TomcatInstance, then go to New > tomcat > VirtualHost
  2. Fill in the following:
    • Name: TomcatPetClinic
  3. Click on Save and close

The end result should look like this:
alt text

Environment

An environment is nothing more than a grouping of one or more Infrastructure CIs you can deploy to. Your environment will only contain the TomcatInstance CI.

  1. Click on the ... next to Environments, then go to New > Environment
  2. Fill in the following:
    • Name: Production (because that's how we roll)
    • Containers: Infrastructure/TomcatHost/TomcatInstance/TomcatPetClinic
  3. Click on Save and close

First Deployment

Finally we can deploy.

  1. First check if you get a HTTP 404 error when opening PetClinic in your browser
  2. In XL-Deploy click on the big Start a deployment button in the center:
    alt text
  3. Drag and drop the following:
    • Applications/PetClinic-war/1.0 to Drag and drop package here
    • Environments/Production to Drag and drop environment here
  4. Click on Preview to see what tasks XL-Deploy will execute to deploy PetClinic
  5. Click on Close preview to return to the previous view
  6. Click on Deploy and PetClinic should be deployed in seconds
  7. Go to PetClinic and browse the application:
    alt text
  8. Go back to XL-Deploy and click on Finish. This will tell XL-Deploy you accept this deployment.

Rollback

What if you just deployed a version of PetClinic in production, but you don't want to accept that version and instead revert to the previous version? Here we going to do just that.

  1. In XL-Deploy click on the big Start a deployment button in the center:
    alt text
  2. Drag and drop the following:
    • Applications/PetClinic-war/2.0 to Drag and drop package here
    • Environments/Production to Drag and drop environment here
  3. Click on Preview and you can see that a task called Destroy petclinic on TomcatPetClinic has been added
  4. Click on Close preview to return to the previous view
  5. Click on Deploy and PetClinic should be deployed in seconds.
  6. Go to PetClinic. You see that the image on the homepage has been changed (if not: refresh the page):
    alt text
  7. Let's say we won't accept this change in PetClinic and we want a rollback. Go back to XL-Deploy and click on Rollback, then Yes.
  8. Go back to PetClinic and refresh the page. The image should revert to this:
    alt text
  9. Go back to XL-Deploy and click on Finish to accept the deployment. Should you want to rollback after accepting a deployment, you can always start a new one.

XL-Release: First Release

XL-Deploy: Reporting

XL-Deploy: Tagging

tgif_xld's People

Contributors

eduardkuijpers-devoteam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.