Automated Import Manager (AIM) Client

 

This utility is planned to be archived later this year. The features provided by it are available out of the box (OOTB) in Appian versions 23.2+. For more information, refer to the Deployment APIs documentation.

Overview

This utility automates the process of inspecting the application, executing DDL scripts, updating CDTs, republishing the appropriate datastores, and importing the application.

With the Automated Import Manager Client, users can automatically deploy applications and package contents (either applications from Appian OR packages generated from the Automated Versioning Manager) to any environment. This utility provides the scripts that support triggering deployments from an external CI tool or deploy from the command line.

Key Features & Functionality

Automated Import Manager:

  • Inspect Application: This tool will automatically mimic the "Inspect" functionality that exists within Appian
  • Validating Application Content: In addition to inspecting the application, the tool will ensure all CDT dependents are included to avoid objects pointing to older versions. (This feature is only available on Appian 7.9 and above)
  • Execute DDL Scripts: DDL scripts can be uploaded and automatically executed. NOTE: For Microsoft SQL Server, only Transact-SQL statements are valid.
  • Execute Migrations with Flyway: Flyway is a tool used for managing database migrations. It makes it easier to track SQL script versions and not re-execute SQL scripts that have already been run. If a Flyway directory is provided, the Automated Import Manager will automatically execute migrations against the corresponding datasource. Learn more about Flyway here.
  • Update CDTs: Users are no longer required to delete CDTs before updating them, this tool will perform this step automatically
  • Import Application and admin console configuration: Automatically import an application with an optional customization file
  • Republish Datastores: After application import, datastores will be automatically published or republished
  • Add Patches: Automatically add patch contents to a specified existing application

For more information, please see visit: https://community.appian.com/w/the-appian-playbook/198/deployment-automation

Note: This utility does not support Java version 9.0. 

Anonymous
  • We have not tried with GitHub. It work in local machine.  If we can get some details on when and why the rename operation happens maybe we can troubleshoot. 

  • Do you know if the same thing works on a GitHub account?

  • Command line - version-application.bat -action buildAllApps -repo_url **** -vc_username **** -vc_password **** -branch_name **** -start_hash **** -end_hash **** -appian_objects_repo_path ****  -package_path *** -local_repo_path "localrepopath"

    Os - git-lfs/2.11.0 (GitHub; windows amd64; go 1.14.2; git 48b28d97)

    More details on the error

    2020-09-15 07:17:16,570 - VersionManagerProperties:
    [vcUsername:######],
    [vcPassword:***],
    [commitMessage:value not provided],
    [action:buildAllApps],
    [applicationPath:value not provided],
    [adminConsolePath:value not provided],
    [ddlPath:value not provided],
    [flywayPath:value not provided],
    [ddlDs:value not provided],
    [uuid:value not provided],
    [applicationName:value not provided],
    [startHash:######],
    [endHash:######],
    [packagePath:######],
    [versionControlType:GIT],
    [repoUrl:######],
    [localRepoPath:localrepopath],
    [branchName:master],
    [appianObjectsRepoPath:######],
    [noUpdate:value not provided],
    [enableFolderListenerCommitMessage:value not provided],
    [proxyPort:value not provided],
    [proxyUrl:value not provided],
    [proxyUsername:value not provided],
    [proxyPassword:value not provided],

    2020-09-15 07:17:16,686 - Missing git repository. Cloning automatically.
    2020-09-15 07:17:16,686 - Cloning from ###### to localrepopath
    2020-09-15 07:17:23,315 - Local repo updated successfully
    2020-09-15 07:17:23,445 - Checking out hash or tag: ######
    2020-09-15 07:17:23,942 - Checking out hash or tag: ######
    2020-09-15 07:17:25,361 - There was an error completing the selected operation. Additional details will be logged.
    2020-09-15 07:17:25,364 - Details of error:
    org.eclipse.jgit.api.errors.JGitInternalException: Could not rename file localrepopath\######\application_files\META-INF\_######\._export.log######.tmp to localrepopath\######\application_files\META-INF\_######\export.log
    at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:328)
    at com.appiancorp.ps.automatedversioning.GitObject.checkout(GitObject.java:206)
    at com.appiancorp.ps.automatedversioning.VCSAndBuildController.buildPackage(VCSAndBuildController.java:227)
    at com.appiancorp.ps.automatedversioning.VCSAndBuildController.buildAllApps(VCSAndBuildController.java:311)
    at com.appiancorp.ps.automatedversioning.AutomatedVersioningManager.main(AutomatedVersioningManager.java:167)
    Caused by: java.io.IOException: Could not rename file localrepopath\######\application_files\META-INF\_######\._export.log######.tmp to localrepopath\######\application_files\META-INF\_######\export.log
    at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:1374)
    at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:499)
    at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:443)
    at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:271)
    ... 4 more
    Caused by: java.io.IOException: Could not rename file D:\######-Runner\builds\######\0\######\######\######\localrepopath\######\application_files\META-INF\_######\._export.log2######.tmp to D:\######-Runner\builds\######\0\######\######\######\localrepopath\######\application_files\META-INF\_######\export.log
    at org.eclipse.jgit.util.FileUtils.rename(FileUtils.java:286)
    at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:1371)
    ... 7 more

  • Can you please provide more information? For example, which command did you run when you saw the error? Which OS?

  • We are getting an error in versining when  we are trying to a build job in gitlab. Both in 2.5.9 and 2.5.11.   The errors always revolves around "org.eclipse.jgit.api.errors.JGitInternalException: Could not rename file". THis mostly happens when multiple branch are there. Anyone has experienced same issue and how they resolved it ? 

  • v2.5.11 Release Notes

    • Enhancements
      • Upgraded Flyway version to 6.5.5 for compatibility with MariaDB.
  • v2.5.10 Release Notes
    • Enhancements
    • Added the ability to dynamically generate the Metadata file for the "buildAllApps" action to reflect only the list of database scripts that are included in the package for a given commit range.
    • Bug Fixes
    • Fixed the interpretation of "appianObjectsRepoPath" on Windows platforms.

  • Did you try setting forceImport=true?

  • Is there any setting wherein even if inspection fails, we can continue with import? Currently, when inspection fails, our script stops over there.

  • Error: java.sql.SQLSyntaxErrorException: ORA-00900: invalid SQL statement

    This only happen when I try to import a sql file with the following statement

    CREATE OR REPLACE EDITIONABLE FUNCTION "DEMO" (p_list IN VARCHAR2)
    RETURN t_my_list
    AS
    l_string VARCHAR2(32767) := p_list || ',';
    l_comma_index PLS_INTEGER;
    l_index PLS_INTEGER := 1;
    l_tab t_my_list := t_my_list();
    BEGIN
    LOOP
    l_comma_index := INSTR(l_string, ',', l_index);
    EXIT
    WHEN l_comma_index = 0;
    l_tab.EXTEND;
    l_tab(l_tab.COUNT) := TRIM(SUBSTR(l_string,l_index,l_comma_index - l_index));
    l_index := l_comma_index + 1;
    END LOOP;
    RETURN l_tab;
    END DEMO;
    /

    apparently it fails due to the first ";", I know this because the function is created till that part:

    ** NOTE: my DB is Oracle

    This issue was supposed to be fixed already with the release June 2018 - Release 2.4.6: https://community.appian.com/w/the-appian-playbook/198/deployment-automation#Script_Execution1 

    any suggestion on how to overcome this issue?