App Factory Command-line Interface

From V9 ServicePack 4, App Factory has added a command-line Interface, which is designed by extending the existing Jenkins CLI. The App Factory Command-line Interface, or AFCLI, can be used to script routine tasks, bulk updates, troubleshooting, and other actions for your App Factory projects. You can use AFCLI to manage the project creation and configuration from your own systems and to minimize interaction with the Jenkins console.

Prerequisites

  • An App Factory user account with the Overall/Read permission
  • The jenkins-cli.jar file, which is used to run commands that are related to App Factory.

    To download the JAR file, use the following URL: <appfactory_url>/jnlpJars/jenkins-cli.jar.
    Make sure that you replace <appfactory_url> with the URL of your App Factory Console, for example: https://a12345.ci.temenos-cloud.com/jnlpJars/jenkins-cli.jar.
  • An App Factory API Token
    This is applicable only if you want to run Jenkins commands by using AFCLI.
    For more information, refer to Generating an API Token in App Factory.

Authentication

To perform actions on your project by using AFCLI, you need to add authentication to your App Factory commands. For more information about the App Factory commands, refer to AFCLI Commands.

The user account that is used for authentication with the Jenkins controller must have the Overall/Read permission to access AFCLI. The account may also require additional permissions for specific commands. For information about the different types of authentication, refer to the following sections.

 

AFCLI Commands

The general syntax to run commands is as follows:

java -jar jenkins-cli.jar [-s JENKINS_URL] [global options] command [command options] [arguments]

The JENKINS_URL parameter can be specified by using the environment variable $JENKINS_URL. You can view the summaries of other general options by running the client without any arguments.

AFCLI provides commands that are specific to your App Factory instance. AFCLI also supports built-in Jenkins CLI commands, such as build or list-jobs. To view the full list of commands that are available in your environment, use the help command, which is a Jenkins command that requires authentication with an API token (-auth). For example:

java -jar jenkins-cli.jar -s "https://a12345.ci.temenos-cloud.com" -auth username:123456 help

To view information about an App Factory command, type the command name after help. For example:

java -jar jenkins-cli.jar -s "https://a12345.ci.temenos-cloud.com" -auth username:123456 help create-project

For information about the different App Factory commands, refer to the following sections.