Build an API archive with the build toolkit

This scenario shows you how to use the build toolkit to generate the API archive from an API project created in the API toolkit.

Before you begin

zosConnect-2.0 Applies to zosConnect-2.0.

About this task

In this task, you use the build toolkit to generate the API archive from the API project that you created in the API toolkit. In an enterprise DevOps workflow, the build toolkit is likely run by a script in basically the same way as demonstrated in the following steps.

Procedure

In this procedure, substitute the Windows example for the platform of your choice. The build toolkit properties files must be encoded in UTF-8.

  1. Create a local directory such as C:/DevOpsScenarios on the Windows system.
  2. Download the build toolkit compressed file, zconbt.zip as a binary file, to the same local directory, C:/DevOpsScenarios.
    The build toolkit is in the IBM z/OS Connect <installation_path> and is called zconbt.zip.
  3. Extract the zconbt.zip file into a zconbt sub directory of the C:/DevOpsScenarios local directory.
  4. Add the zconbt executable file to your path. For example, enter the following command: set PATH=C:/DevOpsScenarios/zconbt/bin;%PATH%
  5. Obtain the API project folder from your source control management system and place it under C:/DevOpsScenarios

    For example, if your Eclipse workspace location is C:/Program Files/IBM/rationalsdp/workspace, you would find a catalog/, contacts/, or stockManager/ folder there. Copy this folder into C:/DevOpsScenarios

  6. Run the build toolkit zconbt command to create the API archive file.
    The build toolkit has the following syntax:
    zconbt --projectDirectory=C:/DevOpsScenarios/<APIProjectFolder> --file=C:/DevOpsScenarios/<apiName>.aar

    Use the -pd parameter to specify the project directory, and the -f parameter to specify the path and the file name of the generated API archive. In a command prompt window, depending on the name of your project, enter one of the following commands:

    zconbt --projectDirectory=C:/DevOpsScenarios/catalog --file=C:/DevOpsScenarios/catalog.aar
    or
    zconbt --projectDirectory=C:/DevOpsScenarios/contacts --file=C:/DevOpsScenarios/contacts.aar
    or
    zconbt --projectDirectory=C:/DevOpsScenarios/stockManager --file=C:/DevOpsScenarios/stockManager.aar

Results

The API archive can be copied to the designated API directory of your server for deployment.

For more information about a general enterprise DevOps workflow and sample DevOps technologies for building the archives and deploying the services and APIs, see DevOps with IBM z/OS Connect.