Logo
 
 

Installing and building custom components

 
 
 
 
The four CloudPortal Business Manager components that can be customized are available in two customization repositories:
  • Bundles available in cpbm-<version>-customization.git are:
    • Bundle citrix.cpbm.custom.model
    • Bundle citrix.cpbm.custom.portal
    • Bundle citrix.cpbm.custom.common
  • Bundle available in cpbm-<version>-ccp-connector-ui.git is:
    • Bundle cloud.cloudplatform.fragment
Note: These git repositories are released along with every CloudPortal Business Manager release.

Any customer or service provider who is interested in customizing these components can follow the steps given below.

 

Pre-requisites for setting up the development setup:

 

Setting up remote and local GIT repositories:

  1. Download the latest CloudPortal Business Manager customization repositories tar ball:

    cpbm-<version>-customization.git.tar.gz

  2. Unzip the customization tar ball:

    $ tar xvf cpbm-<version>-customization.git.tar.gz

    This will be a bare GIT repository which you will use only to pull changes. For example, call it pristine-cpbm-customization repo.

  3. Create another bare repository from the above repository which will be your customer specific repository where you will pull and push changes on daily basis: (Let us call it xyz-cpbm-customization):

    $ git clone --bare </path/to/pristine-cpbm-customization/repo> xyz-cpbm-customization

  4. Create a working directory on your development environment (Let us call it 'Workspace'), change directory to 'Workspace':

    cd </path/to/Workspace>

  5. Clone a normal repository from customer specific repository (created in Step 3, xyz-cpbm-customization):

    $ git clone </path/to/xyz-cpbm-customization>

    This will create a working directory with name <xyz-cpbm-customization>.

  6. Change directory to the one created in previous step:

    cd xyz-cpbm-customization

  7. Add the pristine-cpbm-customization as a remote into the repository on the development instance. For example, call it pristine-remote:

    $ git remote add pristine-remote </path/to/pristine-cpbm-customization/repo>

  8. Create and check out a local development branch:

    $ git checkout -b <local-dev-branch-name> tag-<release version>-GA

    • Example: To create and check out a new branch at tag for CPBM-2.4.0 release, use the command given below:

      $ git checkout -b <local-dev-branch-name> tag-2.4.0-GA

    • Note: By creating a new branch at the tag of the CPBM release, you make sure that you are developing at the correct version of the customization SDK.
  9. Make required changes in any of the custom projects. Commit your changes and push them into your customer specific repository:

    $ git push origin <local-dev-branch-name>

 

Merging existing customization with new version CPBM customization

Once you have set up the repositories as shown above, follow the steps given below whenever a new version of cpbm-customization repo is released:

  1. Untar the customization tar ball into the existing pristine-cpbm-customization repository:

    $ tar xvf cpbm-<version>-customization.git.tar.gz -C </path/to/parent/of/pristine-cpbm-customization/repo>

  2. From your local development repository, fetch changes from pristine-remote:

    $ cd </path/to/Workspace>/<xyz-cpbm-customization>

    $ git fetch pristine-remote

  3. Check out the local development branch where you intend to merge latest changes:

    $ git checkout <local-dev-branch-name>

  4. Merge the release tag into your development branch:

    $ git merge tag-<release version>

    Example: $ git merge tag-2.3.0-GA

  5. Push your changes into customer specific repository after resolving conflicts (if any):

    $ git push origin <local-dev-branch-name>

 

Steps to generate custom jar files:

  1. Make required changes in any of the custom projects. Commit your changes and push them into your customer specific repository:

    $ git push origin <local-dev-branch-name>

  2. Before compiling the code, you need to clean your mvn repo for vmops and Accelerite by using the following command:

    rm -rf <user_home>/.m2/repository/vmops/*

    rm -rf <user_home>/.m2/repository/citrix/*

  3. Build the citrix.cpbm.custom.all project (without running tests):

    mvn clean install -Dmaven.test.skip=true

  4. Above command will create the custom jars under target directory of respective projects.
 

Running Test Cases

To run the tests, you must create all tests schemas, as shown below, into your MySQL database:
  • cloud_portal_test
  • cloud_reports_test
  • cloud_test
  • cloud_usage_test

You can use command given below to run tests:

mvn clean test

 

Steps to deploy updated custom jar files:

  1. Stop the CloudPortal Business Manager server using the command:

    $ service cloud-portal stop

  2. Go to /usr/share/vts3/config.
  3. Open org.eclipse.virgo.repository.properties.
  4. Comment the following lines:
    default_impls.type=watched  default_impls.watchDirectory=default_impls
  5. Uncomment the following lines:
    custom_impls.type=watched  custom_impls.watchDirectory=custom_impls
  6. Modify the line to have custom_impls instead of default_impls
    chain=ext,patches,usr,connectors,connectors_ext,default_impls,prop
    with
    chain=ext,custom_impls,patches,usr,connectors,connectors_ext,prop
    Note: Do not modify the jars under the default_impls directory.
  7. Copy the updated custom jars from target directory of all four custom projects to:

    /usr/share/vts3/custom_impls

  8. Start the CloudPortal Business Manager server using the command:

    $ service cloud-portal start

 

Customizing the Accelerite CloudPlatform Connector UI

  1. Setting up remote and local GIT repositories:
    1. Download the latest CloudPortal Business Manager Accelerite CloudPlatform Connector UI repository tar ball:

      cpbm-<version>-ccp-connector-ui.git.tar.gz

    2. Unzip the Accelerite CloudPlatform UI tar ball:

      $ tar xvf cpbm-<version>-ccp-connector-ui.git.tar.gz

    3. This will be a bare GIT repository, which you will use only to pull changes. For example, call it pristine-cpbm-ccp-connector-ui repo. Create another bare repository from the above repository which will be your customer specific repository where you will pull and push changes on daily basis:

      $ git clone --bare </path/to/pristine-cpbm-ccp-connector-ui/repo> xyz-cpbm-ccp-connector-ui

    4. Create a working directory on your development environment (Let us call it 'Workspace'), change directory to 'Workspace':

      cd </path/to/Workspace>

    5. Clone a normal repository with working directory from customer specific repository on development environment:

      $ git clone </path/to/xyz-cpbm-ccp-connector-ui>

    6. Change directory:

      cd xyz-cpbm-ccp-connector-ui

    7. Add the pristine-cpbm-ccp-connector-ui as a remote into the repository on development instance. For example, call it pristine-remote:

      $ git remote add pristine-remote </path/to/pristine-cpbm-ccp-connector-ui/repo>

    8. Create and checkout a local development branch:

      $ git checkout -b <local-dev-branch-name> tag-<release version>-GA

      • Example: To create and checkout a new branch at tag for CPBM-2.4.0 release, use the command given below:

        $ git checkout -b <local-dev-branch-name> tag-2.4.0-GA

      • Note: By creating a new branch at the tag of the CPBM release, you make sure that you are developing at the correct version of the customization SDK.
  2. Once you have set up the repositories as shown above, follow the steps given below whenever a new version of cpbm-ccp-connector-ui repo is released:
    1. Untar the customization tar ball into the existing pristine-cpbm-ccp-connector-ui repository (run the command on the remote repository):

      $ tar xvf cpbm-<version>-ccp-connector-ui.git.tar.gz -C </path/to/parent/of/pristine-cpbm-ccp-connector-ui/repo>

    2. From your local development repository, fetch the pristine-remote:

      $ git fetch pristine-remote

    3. Check out the local development branch where you intend to merge latest changes:

      git checkout <local-dev-branch-name>

    4. Merge the release tag on pristine-remote into local master:

      $ git merge tag-<release version>

      Example:

      $ git merge tag-2.3.0-GA

    5. Push your changes into customer specific repository after resolving conflicts (if any):

      $ git push origin <development branch>

  3. Steps to generate custom jar files:
    1. Make the required changes in bundle cloud.cloudplatform.fragment.
    2. Commit your changes and push them into your customer specific repository.
    3. Build the cloud.cloudplatform.fragment project (without running tests):

      $ mvn clean install -Dmaven.test.skip=true

    4. Above command will create the custom jar under the:

      cloud.cloudplatform.fragment/target directory

  4. To run the tests, you must create all tests schemas, as shown below, into your MySQL database.
    • cloud_portal_test
    • cloud_reports_test
    • cloud_test
    • cloud_usage_test

    You can use command given below to run tests:

    $ mvn clean test

  5. Steps to deploy updated custom jar files:
    1. Stop the CloudPortal Business Manager server using the command:

      $ service cloud-portal stop

    2. Go to /usr/share/vts3/config.
    3. Open org.eclipse.virgo.repository.properties.
    4. Add the following lines after

      "connectors_ext.watchDirectory=connectors_ext":

      custom_connectors.type=watched  custom_connectors.watchDirectory=custom_connectors
    5. Modify the chain to have custom_connectors included:
      chain=ext,custom_connectors,patches,usr,connectors,connectors_ext,default_impls,prop
      Note: Do not modify the jars under the connectors directory.
    6. Copy the updated custom jars from target directory of custom project to:

      /usr/share/vts3/custom_connectors

    7. Copy dependent bundles from /usr/share/vts3/connectors to /usr/share/vts3/custom_connectors. Dependent bundles are:
      • cloud.cloudplatform
      • cloud.apachecloudstack
      • cloud.apachecloudstack.fragment
      Note: If you customize the Accelerite CloudPlatform Connector UI (cloud.cloudplatform.fragment bundle), then you must use the same version of all the dependent versions. This means that you cannot have one version of Accelerite CloudPlatform Connector UI and higher version of dependent bundles.
    8. Start the CloudPortal Business Manager server using the command:

      $ service cloud-portal start

 
또 다른 질문이 있으십니까? 문의 등록

댓글

 
Adding comment, please wait....

Provide Feedback on Article:

Subject:
Comments:*
Zendesk 제공