Skip to content

Building a Foundry app

To build a Foundry App build, you need to run the buildFoundryApp job. When you perform a build for the first time, you need to configure the build settings. App Factory stores the settings from the build to make configurations of the future builds easier by providing the Rebuild option.

To run the buildFoundryApp job and configure the parameters, follow these steps:

  1. Open the folder of your App Factory project, and then navigate to FoundryBuildsbuildFoundryApp.
  2. Run the job by using the Build with parameters option. You can access the option by following either of these steps.

    Note: If you don’t see the option, you might not have ownership permissions to the project. You can verify whether your name is listed in the Folder Owners section of the project. The Primary owner of the project can add users as secondary owners to grant permissions to the builds.

    • On the right-side of the job row, select the icon that represents Build with Parameters
    • Open the drop-down list for the buildFoundryApp job, and then select Build with Parameters
    • Open the buildFoundryApp job and click Build with Parameters on the left panel
  3. Make sure that you have configured the Foundry Project Settings, and then configure the build parameters for the job. For more information about the parameters, refer to the following sections.

    Source Control related parameters

    ParameterDescription
    SCM_BRANCH Specifies the branch, release tag, or the commit ID of the repository that contains the source code of the Foundry app.

    Java related parameters

    Important: The JAR files that you want to use for your project must follow the Maven naming convention. For more information, refer to JAR file naming convention.

    ParameterDescription
    CLEAN_JAVA_ASSETSSpecifies whether App Factory must remove the JAR files of the Foundry source code that are stored in the repository before the app is imported to Foundry.You can use the parameter with BUILD_JAVA_ASSETS to clean the existing JAR files, and then use the JAR files that are built by the Maven POM scripts in the build pipeline.
    BUILD_JAVA_ASSETSSpecifies whether App Factory must build and import the Java dependencies from the repository. If this parameter is enabled, App Factory checks out the Java source code, compiles it, packages it, and then bundles it with the Foundry app.If this parameter is enabled, App Factory displays the following build parameters:JAVA_PROJECTS_DIRMVN_GOALS_AND_OPTIONSNote: Only Maven 3 is supported as the Java build mechanism.
    JAVA_PROJECTS_DIRSpecifies the path of the directory that contains the Java assets that you want to build.For example, if your Java assets are stored in path/to/Java/Asset1 and path/to/Java/Asset2, the Java directory is path/to/Java.If your Java assets are stored in a separate repository, add the name of the repository as a prefix to the path of the directory.For example, if your repository name is JavaRepo.git, and your Java assets are stored in path/to/Java, the Java directory is JavaRepo/path/to/Java.Note: This parameter is displayed only if BUILD_JAVA_ASSETS is enabled.
    MVN_GOALS_AND_OPTIONSSpecifies the Maven goals that you want to run to build the Java assets. You can also add command line options for the mvn command.The default Maven goals are: clean package.You can invoke Maven with a different set of goals, maven profiles, or additional arguments by using the -D option.For example: clean package -DskipTests -Darg1=foo1 -Darg2=foo2Note: This parameter is displayed only if BUILD_JAVA_ASSETS is enabled.

    Foundry related parameters

    ParameterDescription
    FOUNDRY_APP_CONFIGSpecifies the configuration that App Factory uses to connect the Iris (client) app to corresponding Foundry (server) app.The configuration includes the hosting type, cloud account, environment name, and the Foundry app name.The build pipeline refers to this parameter for the Foundry Account details to Import and Publish the app. For more information, refer to Adding new VoltMX Foundry App Config.
    IMPORTSpecifies whether App Factory must import the Foundry app to the Foundry cloud that is specified in the FOUNDRY_APP_CONFIG.If the parameter is disabled and you want to import the app, you must download the package from the link that is shared in the email and manually import it to Foundry.If this parameter is enabled, App Factory displays the following build parameters:FOUNDRY_CREDENTIALS_IDIMPORT_FOUNDRY_APP_VERSIONPUBLISHNote: To publish the Foundry app to an environment, you must import the app to the Foundry cloud.
    FOUNDRY_CREDENTIALS_IDSpecifies the credentials that App Factory uses to import and publish the app to the Foundry cloud. The Foundry cloud must be specified in the FOUNDRY_APP_CONFIG. For more information, refer to Adding New Cloud Credentials.Note: This parameter is displayed only if IMPORT is enabled.
    IMPORT_FOUNDRY_APP_VERSIONSpecifies the location from which the version of the Foundry app is fetched.To fetch the app version, you can use either of these sources:Meta.json file that is stored in the repositoryFOUNDRY_APP_CONFIG parameterType the version manually
    Note: If you select the Type it in option, App Factory displays the FOUNDRY_APP_VERSION parameter.This parameter is displayed only if IMPORT is enabled.
    FOUNDRY_APP_VERSIONSpecifies the version of the Foundry app that you want to import.The version must be in the format <major>.<minor>, for example: 1.0 or 999.99. The major version must be between 1 and 999, and the minor version must be between 1 and 99.
    Note: This parameter is applicable only if the IMPORT_FOUNDRY_APP_VERSION is selected as Type it in.
    PUBLISHSpecifies whether App Factory must publish the app to the Foundry environment.If the parameter is disabled and you want to publish the app to a run-time environment, you need to manually publish the app from the Foundry console.If you enable this parameter, App Factory displays the following parameters:SERVICE_CONFIG_PATHNote: This parameter is displayed only if IMPORT is enabled.
    SKIP_WEB_CLIENT_DEPLOYMENTSpecifies whether App Factory must skip deploying the client web app. If the parameter is disabled, App Factory overwrites the client web app in the App Services (run time).
    Note:
    1.For composite apps, deployment of the web app is skipped only for the base app. The web app is deployed (and overwritten) for the linked micro apps.
    2.To use this parameter, you must upgrade your project. Otherwise, the web client is overwritten by default.
    3.This parameter is applicable only if the Foundry app contains web client assets and the PUBLISH parameter is selected.
    SERVICE_CONFIG_PATHSpecifies the path to the service configuration JSON file relative to the root of the source code repository. For information about service configuration, refer to Managing Service Profiles.Important: This parameter is only applicable for Foundry Console versions V9SP2 or later.App Factory supports custom locations for the configuration file, but HCL recommends naming the folder configuration. HCL also recommends naming every JSON file after the environment it is meant for. For example: If your environment is called Test Env, your configuration file should be configuration/Test_Env.json.Note: This parameter is displayed only if the PUBLISH parameter is selected.

    Testing

    Note: The test resources must be included as a Maven project at <foundry_project_source>/<testResources>/Cucumber/. Make sure that the pom.xml file is in the testResources/Cucumber/ folder. Alternatively, you can upload the test resources as a zip file in the TEST_ZIP_PACKAGE parameter.


    Parameter Description
    RUN_TESTS Specifies whether App Factory runs tests as part of the buildFoundryApp job.
    MVN_OPTIONS Specifies the Maven options that can be included for the test run. You can also add command-line options for the mvn command. You can invoke Maven with a different set of goals, maven profiles, or additional arguments by using the -D option. For example: clean package -DskipTests -Darg1=foo1 -Darg2=foo2
    TEST_ZIP_PACKAGE Specifies a URL to the zip package that contains the test resources.
    Note:Make sure that the URL is public and accessible from App Factory.
    If you have included the test resources in the SCM, you can skip this parameter.
    TEST_REPORTS_DIRS Specifies the custom reports that are generated during the test run. For example, target/cucumber/cucumber.json.. You can include multiple reports by separating them with a comma (,).

    Custom Hooks related parameters

    ParameterDescription
    RUN_CUSTOM_HOOKSSpecifies whether Custom Hooks must be run as part of the build pipeline. If this parameter is disabled, App Factory does not run Custom Hooks in the build pipeline.

  4. After you configure the parameters for the buildFoundryApp job, click BUILD.

After a Build is successfully triggered, you can check the status of the build in the Build History panel. The following screenshot displays a build that is in progress (#4965) with the progress indicator icon.

You can click the icon to see the detailed output of the current build, or click the progress bar to open the build page of the job. From the build page, you can click Console Output to display the detailed output of the running build.