Video: DevOps with WebSphere Liberty Server

The following transcript is for the DevOps with WebSphere® Liberty Server video, which demonstrates how to develop, build and deploy an application with Liberty server DevOps and some open source tools. This transcript is the video storyboard. Audio describes narration and captions. Onscreen Action describes the content that is shown in the video.

Video Demo- DevOps with WebSphere Liberty Server

Table 1. Title page. Show title and then a basic overview of building, updating, testing, and deploying an application.
Scene Audio Onscreen Action
1 This demo will show you how to provide the capability for building and deploying your application with WebSphere Liberty Server and a set of common open source tools. Show title Demo - DevOps with WebSphere Liberty Server.
2 You will use Git for source control, use WebSphere Application Server Developer Tools to develop your application, and use Maven for build. Show image of 1. Develop and Build Application that uses the following options
  • Git
  • WebSphere Developer Tools (WDT)
  • Maven
3 You will also make changes to your web application running in Liberty and push changes from Eclipse IDE to production environment. Show image of 2. Update Application that uses WDT.
4 You will use Apache Maven together with the WebSphere Liberty Maven plug-in to run integration test to verify your changes. Show image of 3. Test Application with the Liberty Maven plug-in.
5 You will also use Jenkins for continuous integration. Show image of 4. Continuous Integration that uses Jenkins.
6 You will use Chef to push a new build to the production environment.

Liberty will be the Java™ Platform, Enterprise Edition run time for all the preceeding DevOps scenarios. We will use an Airline application - AcmeAir as a sample in this demo. It will demonstrate a controllable and highly repeatable DevOps practice.

Show image of 5. Continuous Deploy that uses Chef.
Table 2. Demo of Developing and Building an Application
Scene Audio Onscreen Action
7 Now lets start the first scenario: develop and build your application.

Open Eclipse, which has WDT already preinstalled.

  1. We will set the workspace preference for use with Maven.
  2. Then we will clone a Git repository containing the AcmeAir application, specify the Git repository URI.
  3. Then we will import the set of Maven based AcmeAir projects: There are 5 Maven-based projects in this repository.
  4. Now we can run the Maven build to build the projects and create application artifacts. Make sure the build is successful when it finishes.
  5. Now we can create a Liberty server to run our application from Eclipse: So specify the Liberty install directory.
  6. And also name the Liberty server.
  7. Then we can open the server.xml to config the server to run our AcmeAir application..
    • First we will specify the <httpEndpoint> endpoint.
    • And we will also add the database configuration, which refers to a Derby database for application data.
  8. Start the WebSphere Liberty server and the AcmeAir application.
  9. Now login to the application and experience it.
  10. You can select your destination and the city from which you depart. Check those available airline tickets and book it.
Show title Step 1 Develop and Build Application.

Demo showing the following steps to develop and build an application that uses WDT.

Open Eclipse, which has WDT preinstalled.

  1. Set the workspace preferences for use with Maven. Click the Set all Maven values button.
  2. We will clone a Git repository containing the AcmeAir application by specify the Git repository URI.
  3. Import the set of Maven-based AcmeAir projects: The acmeair repository contains 5 Maven-based projects.
  4. Now run Maven to build the projects and create the application artifacts. Make sure that the build is successful when it finishes.
  5. Now we can create a WebSphere Liberty server to run the application from Eclipse: Specify the Liberty install directory.
  6. Name the server AcmeAirDemo and add the acmeair-webapp application into it.
  7. Open the server configuration server.xml file to configure the Liberty server for service.
    • Replace the <httpEndpoint> element and add further configuration.
    • Add the database configuration, which refers to a Derby database for application data.
  8. Start the WebSphere Liberty server and AcmeAir application.
  9. Click the application URL to verify that the application is active. Initialize the application by loading the flight data set.
  10. Now AcmeAir is ready for use.
    • Logins to the application and click the Flights action and type in New York under Leave From and Paris under Arrive At.
    • Click the Find Flights or Browse Flights button.
    • Pick any outbound flight and select it by clicking it.
    • Pick any return flight and select it by clicking it.
    • Click the Book Select Flights button.
Table 3. Demo updating application
Scene Audio Onscreen Action
8

In scenario 2 we will make a quick change to our application and show how to do a continuous delivery with that. To simplify the scenario we will just make a very small change to our indexed page. To replace some highlighted content with "Welcome to Acme Air". Now after you save these changes, you can refresh to see that the change is in effect.

Show title Step 2 Update Application

Demo showing the Index page that is being updated in the application.

Table 4. Demo testing the application
Scene Audio Onscreen Action
9 Next we will use Maven and the Liberty Maven plug-in for integration tests.
  1. The AcmeAir application has a acmeair-itests project that contains integration tests.
  2. To enable of the integration tests we will need to edit our pom.xml file. There are a few changes we need to make here, but the most important one is that we will enable and config the Liberty Maven plug-in to start the Liberty server before our integration tests and to stop the server after the tests are done.
  3. We will create a run Configuration for AcmeAir integration tests.
    • Click the Run button to run the integration tests. It will take a few minutes to allow the tests to complete. So its build successfully.
    • Examine the console output to see the Liberty Maven plug-in starting the server before the tests run and to stop it after the test.
  4. You can view the test report and make sure there is no error in the result.
  5. Next we will push the pom.xml change to Git so that the itests can be run in a Jenkins build.
Demo testing the application, that uses the following steps
  1. The AcmeAir application has a acmeair-itests project that contains integration tests.
  2. Enable activation of integration tests by editing the acmeair-itests/pom.xml file.
  3. Enable the Build Helper Maven plug-in to find an available network port.
  4. Enable and configure the Liberty Maven plug-in to start the Liberty server before integration tests are executed and stop the server after the tests are done.
  5. Enable and configure the Maven Failsafe plug-in to execute the integration tests. The tests exercise the REST API of the application.
  6. Create a run Configuration for AcmeAir integration tests.
    • Click the Run button to run the integration tests. The tests should complete successfully.
    • Examine the console output to see the Liberty Maven plug-in starting the server before the tests run.
    • Examine the console output to see the Liberty Maven plug-in stopping the server after the tests.
  7. View the test reports under target/failsafe-reports/ directory.
  8. Push the pom.xml change to Git so the itests can be run in a Jenkins build.
Table 5. Demo showing continuous integration with Jenkins
Scene Audio Onscreen Action
10
  1. In the next scenario we will use Jenkins to create and run a build job for the AcmeAir application. The job will check out the application code from Git, compile the application, execute the tests, and publish the build artifacts. With the configuration in Schedule, the job will poll the Git repository every two minutes and automatically start a build if any changes are detected.
    • Specify the Liberty install directory.
    • We will also add a post-build action and choose Archive the artifacts.
    • After a minute or 2 the build should automatically start.
  2. Once the build completes and is successful, examine the build job results. The Test Result should indicate there is no failure.
  3. Switch back to Eclipse and commit the changes made on the Index page.
  4. Switch back to Jenkins and you will see within 2 minutes a new build should appear under the Build History table.
Show title Step 4 Continuous Integration

Demo showing continuous integration with Jenkins using the following steps:

  1. We will use Jenkins to create and run a build job for the AcmeAir application. The job will check out the application code from Git, compile the application, execute the tests, and publish the build artifacts. With the configuration in Schedule, the job will poll the Git repository every two minutes and automatically start a build if any changes are detected.
    • We will click the Add post-build actions button and choose Archive the artifacts.
    • After a minute or 2 a build should automatically start.
  2. Once the build completes and is successful, examine the build job results. The acmeair-webapp-1.0-SNAPSHOT.war file should appear under Build Artifacts and Test Result should indicate no failures.
  3. Switch back to Eclipse and commit the changes that are made on the Index page.
  4. Switch to Firefox and go to http://server:9080/jenkins/job/AcmeAir tests/ address. Within 2 minutes a new build should appear under the Build History table.
    • Click the new build and verify that the correct commit message appears under Changes.
Table 6. Demo showing continuous deployment with Chef
Scene Audio Onscreen Action
11
  1. In the last scenario we will do a continuous deployment with Chef.
    • Open a terminal window.
    • Create an empty cookbook
    • Edit the metadata file of the cookbook
    • Edit the recipe file
    • Upload the AcmeAir cookbook to the Chef server
  2. Also register the template node with the Chef server.
  3. You can config the template node configuration on the Chef server.
  4. Then you can populate the Chef node. This will cause the chef-client command to run on the template node. The AcmeAir application should be fully deployed and running on the template node. To verify that, switch to Firefox and open the template application server to check the results.
  5. Then we will create a new Jenkins build job to invoke chef-client on the template node to update it, only after all the integration tests pass.
    • On the Jenkins console, edit the AcmeAir tests job.
    • Under Post-build Actions click on Add post-build action and choose Build other projects.
    • Under Projects to build type in AcmeAir-Chef.
    • Verify that the AcmeAir tests job triggers the AcmeAir-Chef job by requesting a AcmeAir tests build.

We just demonstrate DevOps practice with Liberty and common open source tools. You can now try the full End to End DevOps scenarios all together repeatedly. While in this demo we choose Chef, WDT, Maven, and Jenkins, these technologies can easily be interchangeable with other DevOps tools like uDeploy®, Puppet, etc,, Thanks for watching.

Show title Step 5 Continuous Deploy

Demo showing continuous deployment with Chef that uses the following steps:

  1. Create a cookbook to deploy AcmeAir
    • Open a terminal window.
    • Create an empty cookbook
    • Edit the metadata file of the cookbook
    • Edit the default.rb recipe file
    • Upload the AcmeAir cookbook to the Chef server
  2. Bootstrap the Chef node and register the template node with the Chef server.
  3. Configure the template node configuration on the Chef server.
  4. Populate the Chef node. Execute the knife ssh name:template sudo chef-client command. This will cause the chef-client command to run on the template node. Chef-client will execute a set of cookbooks on the node. The AcmeAir application should be fully deployed and running on the template node. To verify, switch to Firefox and open the http://template:9081/acmeair/ address.
  5. Populate the Chef node automatically with Jenkins. We will create a new Jenkins build job that will invoke chef-client on the template node to update it, only after all the integration tests pass.
    • On the Jenkins console, edit the AcmeAir tests job.
    • Under Post-build Actions click Add post-build action and choose Build other projects.
    • Under Projects to build type in AcmeAir-Chef.
    • Verify that the AcmeAir tests job triggers the AcmeAir-Chef job by requesting a new AcmeAir tests build.