Skip to main content

Application Commands

In this section, you will learn more about the Application's commands.


CommandDescription
stk create appCreates an application from one or more plugins.
stk delete appDeletes an Application hosted in a remote repository.
stk deploy appDeploys an application to a specific environment.
stk destroy appDestroys an application from an environment.
stk list appLists all applications registered to a workspace.
stk register appRegisters an application to a workspace.
stk register app-deployRegisters the deployment of an Application in a Workspace.
stk register app-destroyRecords the destruction of an Application in a Workspace.
stk rollback appRollback an application to a previous version.
stk update appUpdates the Application data.
stk validate appValidates the structure of an application.

stk create app

The stk create app command creates an application from a Starter. The application is generated with the capabilities of the Plugins used in the Starter, which can be applications with business rules, infrastructure, or some specific functionality.

Applications created outside of a Workspace cannot be registered and deployed to StackSpot.

tip

The -o, --target option allows you to define a different folder name to create the Application content. If the folder does not exist, it will be created.

If you do not use the -o or --target option, the Application content folder name will be the same as the one you gave when creating your Application.

Usage

stk create app [APP_NAME] --starter [STUDIO/STACK/STARTER]
info

The use of the stk create app command with the --starter [ACCOUNT/STUDIO/STACK/STARTER] flag and options is deprecated and will be removed. Use the flag without ACCOUNT information, as shown in the following example:

stk create app my-app-name --starter my-studio/my-stack/starter-name

Parameters

OptionDescriptionExample
NOME_APPThe name of the application. If not specified, the name of the repository of the --remote parameter will be used.
stk create app my-app-name
-s, --starter, --starter studio-slug/stack-slug/starter-slugThe starter that will apply the set of plugins to your application. You must specify the name of the starter and its source data, such as studio and stack. You can choose the Stack in the terminal interactively.
You can choose the Stack version by informing the -s, --starter flag and the Stack version with --starter studio-slug/stack-slug@[number-version]/starter-slug .
You can enter the file path of a Starter (starter.yaml) to create the Application with a local Starter.
stk create app my-app-name --starter my-studio/my-stack/starter-name
Choose the Stack version:
stk create app my-app-name --starter my-studio/my-stack@3.0.0/starter-name
Choose a local Starter:
stk create app my-app-name --starter User/Documents/My -Local-Starters/starter-name.yaml
-r, --remote <git-url>The URL of the remote Git repository that is used as the project source. If not specified, the remote repository will not be configured and you must do the process manually.
stk create app my-app-name --remote my-git-repository-url
-sgi, --skip-git-initDo not initialize a Git repository during app creation.
stk create app my-app-name --skip-git-init
-d, --descriptionA description of your application and its purpose.
stk create app my-app-name --description "my app description" --starter my-studio/my-stack/starter-name
-q, --non-interactiveDo not prompt the user for input parameters and return an error if any required parameter is not provided.
stk create app studio/stack/plugin --non-interactive
-sp, --spec [TEXTO]The path to the specification file that contains the inputs and connections data for each applied plugin.
stk create app my-app-name --spec /home/user/specs-folder/app.yaml
-o, --targetThe -o, --target option allows you to define a different folder name to create the Application content. If the folder does not exist, it will be created. If you do not use the -o or --target option, the Application content folder name will be the same as the one you gave when creating your Application.
stk create app my-app-name --starter my-studio/my-stack/starter-name --target home/user/Applications/my-app 
-er, --extra-repositories TEXTProvide a list of additional repositories for your Application. Each repository should be an JSON object with the following structure: "[{"name":"repository_name", "description": "repository_description", "provider": "repository_provider", "url": "repository_url"}]"stk create app my-example-app --starter studio/stack/starter-name --extra-repositories "[{"name":"my-example-app-repo", "description": "repository for test my apps", "provider": "github", "url": "https://github.com/my-organization-name/my-example-app-repo"}]"
-h, --helpDisplays the command help and exits.
stk create app --help

stk delete app

The stk delete app command completely deletes an Application from a Workspace. The Application does not rollback, it also deletes the Application registration on StackSpot and the repository content used to deploy the Application.

Usage

If your Application has active Infrastructure Plugins with the deployment done by self-hosted Runtime, the stk delete app command is interrupted, and you must destroy your Application's Infrastructure first. If you haven't used the self-hosted Runtime and your Application has active deployments in one or more environments, the following actions occur:

  • The command checks if the Infrastructure can be destroyed, and if possible, the Infrastructure is destroyed.
  • Only when the Infrastructure in all environments is successfully destroyed, meaning no more active deployments, the Connection Interfaces generated by the Infrastructure Plugins and the Application and the Infrastructure records are deleted.

Otherwise, without any active deployments, only the Application or Infrastructure record is deleted.

Syntax

stk delete app --target [APPLICATION DIRECTORY]

Example:

warning

This command works only with pipelines, you must have the STK CLI installed in your pipeline. Check out the following example using the command within the steps of a pipeline:

In the application folder, execute the command entering the following parameters:

.github/workflows/run-cli-commands.yml
steps:
- name: Delete App
run: |
stk delete app --target ./Applications/my-app

Parameters

OptionDescriptionExample
-o, --targetDefines the target directory to delete the Application.
stk delete app --target ./Applications/my-app 
-h, --helpDisplays command help and exits.
stk delete app --help

stk deploy app

The stk deploy app command deploys your Application to an environment in your Workspace.

Before running the command, you must:

  1. Log in to your account with the stk login command.
  2. If you do not have an active workspace, access a workspace with the stk use workspace command.

Usage

stk deploy app

Parameters

OptionDescriptionExample
-v, --versionSet the deployment tag version. You must use the semantic versioning standard. Example: "1.0.0"
stk deploy app --version 1.0.0
-e, --envSet the name of the environment that will be used to run or deploy the application. You can view the available environments in your workspace with the stk list env command.
stk deploy app --env qa
-b, --branchName of the Git branch that will be used in the deployment. Optional.
stk deploy app --branch app2-last-release
--open-api-pathPath to the Open API file relative to the root of the Git repository. Optional.
stk deploy app --open-api-path /home/user/my-app-folder
-w, --watchMonitors the deployment status automatically.
stk deploy app --env qa --watch
-h, --helpDisplays the command help and exits.
stk deploy app --help

stk destroy app

warning

This feature is temporarily disabled. During this period, if you need to destroy an Application, please contact our support team.

The stk destroy app command destroys an application from an environment.

Usage

Syntax

stk destroy app --env<ENV_NAME>

Example

To destroy an application, you must access the folder of the application and execute the command:

cd my-app-folder
stk destroy app --env prod

Parameters

OptionDescriptionExample
-e, --envThe environment where the application was deployed. Required.
stk destroy app --env prod
-w, --watchMonitors the application destruction status automatically.
stk destroy app  --env prod --watch
-q, --non-interactiveDoes not prompt the user for input parameters and returns an error if any required parameter is not provided.
stk destroy app --env prod --non-interactive
-h, --helpDisplays the command help and exits.
stk destroy app --help

stk list app

The stk list app command lists all applications registered in your Workspace in the terminal.

To use this command, you must:

  1. Log in to your account with the stk login command.
  2. If you do not have an active workspace, access a workspace with the stk use workspace command.

Usage

stk list app

Parameters

OptionDescriptionExample
-h, --helpDisplays the command help and exits.
stk list app --help

stk register app

The stk register app command registers an application in your workspace.

To use this command, you must:

  1. Log in to your account with the stk login command.
  2. If you do not have an active workspace, access a workspace with the stk use workspace command.

Usage

Run the command in the application folder:

stk register app

Parameters

OptionDescriptionExample
-r, --remoteThe URL of the remote Git repository that is used to host your application. If not specified, the remote repository will not be configured and you must do the process manually.
stk register app --remote url
-bb, --base-branchhe name of the base branch of your application's repository.
stk register app --base-branch my-app-release-branch
-er, --extra-repositories TEXTProvide a list of additional repositories for your Application. Each repository should be an JSON object with the following structure: "[{"name":"repository_name", "description": "repository_description", "provider": "repository_provider", "url": "repository_url"}]"stk register app --base-branch my-app-release-branch --extra-repositories "[{"name":"my-example-app-repo", "description": "repository for test my apps", "provider": "github", "url": "https://github.com/my-organization-name/my-example-app-repo"}]"
-h, --helpDisplays the command help and exits.
stk register app --help

stk register app-deploy

The stk register deploy command registers the deployment of an Application in your Workspace for Applications that do not use StackSpot Deploy.

Usage

warning

This command only works with pipelines, you must have the STK CLI installed in your pipeline. Check out the following example using the command within the steps of a pipeline:

Before executing the command, you must:

  1. Log in to your Account with the stk login command.
  2. If you have an active Workspace, access it with the stk use workspace command.
.github/workflows/run-cli-commands.yml
steps:
- name: Authenticate StackSpot
run: |
stk login --client-id ${{ secrets.CLIENT_ID }} --client-key ${{ secrets.CLIENT_KEY }} --realm ${{ secrets.CLIENT_REALM }}

- name: Use your Workspace
run: |
stk use workspace my-workspace-name

- name: Register App Deployment
run: |
stk register app-deploy --env prod --status success --version 1.0.0 --target ./Apps/my-app

Execute the following command within the Application folder:

stk register app-deploy --env prod --status success --version 1.0.0 --target ./Apps/my-app

Parameters

OptionDescriptionExample
-e, --envName of the environment to register the Application deployment.
stk register app-deploy --env dev
-s, --status [error, success]Fill in the Application deployment status that must be registered on StackSpot. The accepted values ​​are error (for deployment errors) and success (for deployment success).
stk register app-deploy --status success
-v, --versionEnter the version of the deploy Application that you want to register with StackSpot.
stk register app-deploy --env prod --status success --version 1.0.0
-o, --targetEnter the directory where the Application is deployed to be registered.
stk register app-deploy --env prod --status success --version 1.0.0 --target ./Apps/my-app
-h, --helpDisplays command help and exits.
stk register app-deploy --help

stk register app-destroy

The stk register destroy command registers the destruction of an Application in your Workspace for Applications that do not use StackSpot Deploy.

Usage

warning

This command only works with pipelines, you must have the STK CLI installed in your pipeline. Check out the following example using the command within the steps of a pipeline:

Before executing the command you must:

  1. Log in to your Account with the stk login command.
  2. If you have an active Workspace, access it with the stk use workspace command.
.github/workflows/run-cli-commands.yml
steps:
- name: Authenticate StackSpot
run: |
stk login --client-id ${{ secrets.CLIENT_ID }} --client-key ${{ secrets.CLIENT_KEY }} --realm ${{ secrets.CLIENT_REALM }}

- name: Use your Workspace
run: |
stk use workspace my-workspace-name

- name: Register App Deployment
run: |
stk register app-destroy --env prod --status success --target ./Apps/my-app

Execute the command within the Application folder:

stk register app-destroy --env dev --status fail --target ./Apps/my-app

Parameters

OptionDescriptionExample
-e, --envName of the environment to register the Application destroy.
stk register app-destroy --env dev
-s, --status [success, failure]Fill in the destruction status of the Application that must be registered on StackSpot. The accepted values ​​are success (for deployment success) and failed (for deployment failures).
stk register app-destroy --status success
-o, --targetEnter the directory where you will register the Application and destroy it.
stk register app-destroy --env prod --status success --target ./Apps/my-app
-h, --helpDisplays command help and exits.
stk register app-destroy --help

stk rollback app

The stk rollback app command rolls back your application to a previous version.

Usage

Syntax

stk rollback app --version<VERSION> --env<ENV_NAME>

Example

stk rollback app --version 1.2.0 --env prod

Parameters

OptionDescriptionExample
-v, --versionThe tag version used in the deployment. The pattern must follow semantic versioning.
stk rollback app --version 1.2.0 --env prod
-e, --envThe environment that will be used to perform the rollback. You can consult the available environments using the stk list env command
stk rollback app --version 1.2.0 --env prod
-w, --watchMonitors the application rollback status automatically.
stk rollback app --version 1.2.0 --env prod --watch
-q, --non-interactiveDoes not prompt the user for input parameters and returns an error if any required parameter is not provided.
stk rollback app --version 1.0.0 --env prod --non-interactive

| -h, --help | Displays the command help and exits. |

stk rollback app --help
|


stk update app

The stk update app command updates the Application data in StackSpot.

You can update the following Application data:

  • name;
  • description;
  • repository URL;
  • default branch.

Usage

Syntax

stk update app [OPTIONS]

Example

stk update app --description "Updated Application description"
info

Data stored in the application's metadata will be synchronized with the API.

Parameters

OptionDescriptionExample
-n, --name TEXTIt adds the application name.
stk update app --name app-renamed
-d, --description TEXTThe Application description to set.
stk update app --description "my  new Application description"
-r, --repo-url TEXTAdds the Application's Git repository URL.
stk update app --repo-url https://github.com/my-org/my-new-app-repository
-b, --repo-base-branch TEXTAdds the Application Git base branch.
stk update app --name "update/app-branch-name"
-q, --non-interactiveActivate the non-interactive mode and do not request any missing parameters.
stk update app --non-interactive
-er, --extra-repositories TEXTProvide a list of additional repositories for your Application. Each repository should be an JSON object with the following structure: "[{"name":"repository_name", "description": "repository_description", "provider": "repository_provider", "url": "repository_url"}]"stk update app --name app-renamed --extra-repositories "[{"name":"my-example-app-repo", "description": "repository for test my apps", "provider": "github", "url": "https://github.com/my-organization-name/my-example-app-repo"}]"
-h, --helpDisplays the command help and exits.
stk update app --help

stk validate app

The stk validate app command validates the structure of an application. To validate an application, run the command in the application's folder.

The command will:

  • Validate the structure of your application;
  • Remove empty folders;
  • Ignore files and folders that you don't want when finishing your application development.
info

Files ignored in the .gitignore file will not be validated by the command.

At the end of the command execution, it displays a message with the inconsistencies and the validation result.

Usage

stk validate app

Parameters

OptionDescriptionExample
-v, --verboseOption to list the details of all analyzed, validated, and ignored items in your application.
stk validate app --verbose
-h, --helpDisplays the command help and exits.
stk validate app --help