< Previous | Next >

Lesson 1: Adding components

Components are groups of deployable artifacts that make up an application. Components include runnable files, images, databases, and configuration instructions.
The JPetStore sample application includes three components: In most cases, you add components by connecting the IBM® UrbanCode Deploy server to the system that hosts the artifacts. The server can import artifacts from many build systems and source-code management systems. The server can create new versions of the components automatically as the artifacts change or as new builds run. However, for simplicity, in this lesson you copy the files for the components to the server and access them from there. For more information about creating components from artifacts on build systems and source-code management systems, see Creating components.
  1. Download the artifacts.zip file by clicking the following link: artifacts.zip

    You can also find this file in the Files section of the DevOps Learning Circle on IBM developerWorks:https://www.ibm.com/developerworks/community/groups/service/html/communityview?communityUuid=860ff390-6cab-4f95-ab37-66d2ca7521b4

  2. Copy the artifacts.zip file to the IBM UrbanCode Deploy server and extract it. This file contains separate folders for each of the components; these folders are named app, web, and db. Each of these folders contains one or more folders with names such as 1.0 or 1.1; these folders represent different versions of the artifacts.

    For the tutorial, these folders must be on the same system that hosts the IBM UrbanCode Deploy server.

  3. Log in to the IBM UrbanCode Deploy server.
  4. Create the application component:
    1. Click the Components tab and then click Create New Component. In this window, you specify where the artifacts for the component are.
    2. In the Name field, type JPetStore-APP.
    3. In the Source Config Type list, select File System (Versioned).
    4. In the Base Path field, specify the location of the app folder on the server, such as /home/user1/artifacts/shared/app.
    5. Accept the default values for the other fields on the page. The Preserve Execute Permissions and Import Versions Automatically check boxes are cleared and the Copy to CodeStation check box is selected. The Default Version Type is set to Full.
    6. Click Save.
  5. Import the versions of the component:
    1. Click the Versions tab.
    2. Click Import New Versions. The server creates versions of the component based on the folders in the app folder. In this case, the server creates a single version of the component that is based on the app/1.0 folder.
    3. Verify that version 1.0 of the component appears in the list of versions, as in the following figure:
      The first version of the new component is shown on the Versions tab
    Now the component is available to be used in one or more applications.
  6. Create the database component:
    1. Click the Components tab and then click Create New Component again.
    2. Specify the name to be JPetStore-DB.
    3. In the Source Configuration Type list, select File System (Versioned).
    4. In the Base Path field, specify the location of the db folder on the server, such as /home/user1/artifacts/shared/db.
    5. Accept the default values for the other fields on the page.
    6. Click Save.
    7. Click Versions and then click Import New Versions.
    Now the server shows two versions of the database component.
  7. Create the web component:
    1. Click the Components tab and then click Create New Component again.
    2. Specify the name to be JPetStore-WEB.
    3. In the Source Configuration Type list, select File System (Versioned).
    4. In the Base Path field, specify the location of the web folder on the server, such as /home/user1/artifacts/shared/web.
    5. Accept the default values for the other fields on the page.
    6. Click Save.
    7. Click Versions and then click Import New Versions.
    Now the server shows two versions of the web component.
  8. So that you can try updating the components later, delete the newest versions of the database and web components:
    1. Click Components and then click the JPetStore-DB component.
    2. Click Versions.
    3. In the list of versions, in the same row as the version that is named 1.1, click Delete. You will import this version again later.
    4. Similarly, delete version 1.1 of the JPetStore-Web component.
In addition to files and other artifacts, components also contain component processes, which describe how to deploy, install, uninstall, update, or run other tasks on a component. In the next lesson, you create processes that describe how to install the components.

Lesson checkpoint

In this lesson, you added components that are based on files in the file system. In a production scenario, you would connect the component to a source-code management system such as Subversion or a build system such as Jenkins.
On the Components page, you now have three components, each with one version, as shown in the following figure:
The three components on the Components tab
In a later lesson, you add these components to an application.
For more information about creating components, see Creating components.
< Previous | Next >

Feedback