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:
- The application component includes the logic of the application.
This component consists of a single web archive file that is named JPetStore.war.
- The web component includes the static web content for the application,
including images for the web interface.
- The database component includes the database for the application
and scripts that upgrade the database schema to new versions.
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.
- 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
- Copy the artifacts.zip file to the IBM UrbanCode Deploy agent
computer 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 agent.
- Log in to the IBM UrbanCode Deploy server.
- Create the application component:
- Click the Components tab and
then click Create New Component. In
this window, you specify where the artifacts for the component are.
- In the Name field, type JPetStore-APP.
- In the Source Config Type list,
select File System (Versioned).
- In the Base Path field, specify
the location of the app folder on the server,
such as /home/user1/artifacts/shared/app.
- Under Default Version Type, click Import
new component versions using a single agent and then select
your agent in the Agent for Version Imports list
- Accept the default values for the other fields on the
page.
- Click Save.
- Import the versions of the component:
- Click the Versions tab.
- Click Import New Versions. The import process appears in the Currently
Running Version Imports section. Then the process is finished,
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.
You might need to refresh the page to see the new
- Verify that version 1.0 of the component appears in
the list of versions, as in the following figure:
Now the component is available to be used in one or more
applications.
- Create the database component:
- Click the Components tab and
then click Create New Component again.
- Specify the name to be JPetStore-DB.
- In the Source Configuration Type list,
select File System (Versioned).
- In the Base Path field, specify
the location of the db folder on the server,
such as /home/user1/artifacts/shared/db.
- Under Default Version Type, click Import
new component versions using a single agent and then select
your agent in the Agent for Version Imports list
- Accept the default values for the other fields on the
page.
- Click Save.
- Click Versions and then click Import
New Versions.
Now the server shows two versions of the database component.
- Create the web component:
- Click the Components tab and
then click Create New Component again.
- Specify the name to be JPetStore-WEB.
- In the Source Configuration Type list,
select File System (Versioned).
- In the Base Path field, specify
the location of the web folder on the server,
such as /home/user1/artifacts/shared/web.
- Under Default Version Type, click Import
new component versions using a single agent and then select
your agent in the Agent for Version Imports list
- Accept the default values for the other fields on the
page.
- Click Save.
- Click Versions and then click Import
New Versions.
Now the server shows two versions of the web component.
- So that you can try updating the components later, delete
the newest versions of the database and web components:
- Click Components and then click
the JPetStore-DB component.
- Click Versions.
- 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.
- 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.