WildFly CLI Deployment Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 45: Line 45:
Absolute or relative. Not required if the deployment already exists in the [[WildFly Concepts#Deployment_Artifact_Repository|artifact repository]].
Absolute or relative. Not required if the deployment already exists in the [[WildFly Concepts#Deployment_Artifact_Repository|artifact repository]].


==name==
==--name==


The unique name of the deployment. If the file path argument is specified the name argument is optional, the file name is the default value.  
The unique name of the deployment. If the file path argument is specified the name argument is optional, the file name is the default value.  


==runtime-name==
==--runtime-name==


Optional argument. The runtime name for the deployment. This will form the basis for default Java EE application and module names. If not specified the value used for <tt>--name</tt> will be used.  
Optional argument. The runtime name for the deployment. This will form the basis for default Java EE application and module names. If not specified the value used for <tt>--name</tt> will be used.  
Line 55: Line 55:
There are cases when users may wish to have two deployments with the same <tt>runtime-name</tt> (two versions of application) both available in the management configuration, in which case the deployments would need to have distinct <tt>name</tt> values but would have the same <tt>runtime-name</tt>. Within an individual server, only one deployment with a given 'runtime-name' can deployed. However, multiple deployments with the same <tt>runtime-name</tt> can exist in the configuration, so long as only one is enabled.
There are cases when users may wish to have two deployments with the same <tt>runtime-name</tt> (two versions of application) both available in the management configuration, in which case the deployments would need to have distinct <tt>name</tt> values but would have the same <tt>runtime-name</tt>. Within an individual server, only one deployment with a given 'runtime-name' can deployed. However, multiple deployments with the same <tt>runtime-name</tt> can exist in the configuration, so long as only one is enabled.


--force           - if the deployment with the specified name already exists,
==--force==
                    by default, deploy will be aborted and the corresponding
                    message will printed. Switch --force (or -f) will force the
                    replacement of the existing deployment with the one
                    specified in the command arguments.


--disabled      - indicates that the deployment has to be added to the
If the deployment with the specified name already exists, by default, deploy will be aborted. <tt>--force</tt> (or <tt>-f</tt>) will force the replacement.
                    repository disabled.


--unmanaged      - if this argument is not specified, the deployment content
==--disabled==
                    will be copied (i.e. uploaded) to the server's deployment
                    repository before it is deployed. If the argument is
                    present, the deployment content will remain at and be
                    deployed directly from its original location specified with
                    the file_path.
                    NOTE: exploded deployments are supported only as unmanaged.


--server-groups  - comma separated list of server group names the deploy
Indicates that the deployment has to be added to the repository disabled.
                    command should apply to. Either server-groups or
                    all-server-groups is required in the domain mode. This
                    argument is not applicable in the standalone mode.


--all-server-groups  - indicates that deploy should apply to all the available
==--unmanaged==
                        server groups. Either server-groups or all-server-groups
                        is required in domain mode. This argument is not
                        applicable in the standalone mode.


-l              - in case none of the required arguments is specified the
If this argument is not specified, the deployment content will be copied (i.e. uploaded) to the server's deployment repository before it is deployed.  
                    command will print all of the existing deployments in the
                    repository. The presence of the -l switch will make the
                    existing deployments printed one deployment per line,
                    instead of in columns (the default).


  --headers        - a list of operation headers separated by a semicolon. For
If the argument is present, the deployment content will remain at and be  deployed directly from its original location specified with the <tt>file_path</tt>.Exploded deployments are supported only as unmanaged.
                    the list of supported headers, please, refer to the domain
                    management documentation or use tab-completion.


--script        - optional, can appear only if the file_path points a cli
==--server-groups|--all-server-groups == 
                    archive. The value is the name of the script contained in a
                    cli archive to execute. If not specified, defaults to
                    'deploy.scr'. A cli archive is a zip archive containing
                    script(s) as well as artifacts or applications to deploy.
                    To be recognized as a cli archive, the extension of the
                    archive file should be '.cli'. The deploy command will
                    execute the script given by the --script argument. All paths
                    in the scripts are relative to the root directory in the cli
                    archive. The script is executed as a batch.


</font>
Comma separated list of server group names the deploy command should apply to. Either <tt>--server-groups</tt> or <tt>--all-server-groups</tt> is required in the domain mode. This argument does not apply to standalone mode.
 
==-l==
 
Without arguments <tt>deploy</tt> will print all of the existing deployments in the repository. The presence of the <tt>-l</tt> switch will make the existing deployments printed one deployment per line,  instead of in columns (the default).
 
==--headers==
 
A list of operation headers separated by a semicolon.
 
==--script==
 
Used only if the <tt>file_path</tt> points a [[CLI archive|CLI archive]]. The value is the name of the script contained in a <tt>cli</tt> archive to execute. If not specified, defaults to '<tt>deploy.scr</tt>'.  The deploy command will execute the script given by the --script argument. All paths in the scripts are relative to the root directory in the cli  archive. The script is executed as a batch.


=Undeploy Usage=
=Undeploy Usage=

Revision as of 22:59, 22 February 2016

External

Internal

Overview

Deployments are executed with the deploy command.

Undeployments are executed with the undeploy command.

In-line usage details can be obtained with:

deploy --help
undeploy --help

deploy/undeploy interact with domain/AS instance's Deployment ArtifactRepository.

Deploy Usage

deploy 
    (file_path [--script=script_name] [--name=deployment_name] 
                   [--runtime-name=deployment_runtime_name] 
                   [--force | --disabled] [--unmanaged]
    )
    | 
    --name=deployment_name  
   [--server-groups=group_name (,group_name)* | --all-server-groups] 
   [--headers={operation_header (;operation_header)*}]

deploy deploys the application designated by the file_path or enables an already existing but disabled deployment.

If executed w/o arguments, will list all the existing deployments.

file_path

Absolute or relative. Not required if the deployment already exists in the artifact repository.

--name

The unique name of the deployment. If the file path argument is specified the name argument is optional, the file name is the default value.

--runtime-name

Optional argument. The runtime name for the deployment. This will form the basis for default Java EE application and module names. If not specified the value used for --name will be used.

There are cases when users may wish to have two deployments with the same runtime-name (two versions of application) both available in the management configuration, in which case the deployments would need to have distinct name values but would have the same runtime-name. Within an individual server, only one deployment with a given 'runtime-name' can deployed. However, multiple deployments with the same runtime-name can exist in the configuration, so long as only one is enabled.

--force

If the deployment with the specified name already exists, by default, deploy will be aborted. --force (or -f) will force the replacement.

--disabled

Indicates that the deployment has to be added to the repository disabled.

--unmanaged

If this argument is not specified, the deployment content will be copied (i.e. uploaded) to the server's deployment repository before it is deployed.

If the argument is present, the deployment content will remain at and be deployed directly from its original location specified with the file_path.Exploded deployments are supported only as unmanaged.

--server-groups|--all-server-groups

Comma separated list of server group names the deploy command should apply to. Either --server-groups or --all-server-groups is required in the domain mode. This argument does not apply to standalone mode.

-l

Without arguments deploy will print all of the existing deployments in the repository. The presence of the -l switch will make the existing deployments printed one deployment per line, instead of in columns (the default).

--headers

A list of operation headers separated by a semicolon.

--script

Used only if the file_path points a CLI archive. The value is the name of the script contained in a cli archive to execute. If not specified, defaults to 'deploy.scr'. The deploy command will execute the script given by the --script argument. All paths in the scripts are relative to the root directory in the cli archive. The script is executed as a batch.

Undeploy Usage

[domain@172.31.17.207:9999 /] undeploy --help SYNOPSIS

   undeploy name [--server-groups=group_name (,group_name)* |
                  --all-relevant-server-groups] [--keep-content]
                 [--headers={operation_header (;operation_header)*}]

DESCRIPTION

   Undeploys the deployment with the given name and, depending on the
   arguments, removes its content from the repository.
   If the deployment name isn't specified, prints the list of all the existing
   deployments.

ARGUMENTS

name             - the name of the deployment to undeploy.
--server-groups  - comma separated list of server group names the undeploy
                   command should apply to. Either server-groups or
                   all-relevant-server-groups is required in the domain mode.
                   This argument is not applicable in the standalone mode.
--all-relevant-server-groups   - indicates that undeploy should apply to all
                                 the server groups in which the deployment is
                   enabled. Either server-groups or all-relevant-server-groups
                   is required in domain mode. This argument is not applicable
                   in the standalone mode.
--keep-content   - by default undeploy, besides disabling the deployment, also
                   removes its content from the repository. The presence of
                   --keep-content will only disable the deployment w/o removing
                   its content from the repository. This argument can be used
                   in both standalone and domain modes.
-l               - in case the deployment name isn't specified, the presence of
                   the -l switch will make the existing deployments printed one
                   deployment per line, instead of in columns (the default).
--headers        - a list of operation headers separated by a semicolon. For
                   the list of supported headers, please, refer to the domain
                   management documentation or use tab-completion.
                         
--path           - optional, points to a cli archive. The path can be either
                   absolute or relative to the current directory. A cli archive
                   is a zip archive containing script(s) as well as artifacts
                   or applications to deploy. To be recognized as a cli
                   archive, the extension of the archive file should be '.cli'.
                   The undeploy command will execute the script given by the
                   --script argument.                          
                         
--script         - optional, can appear only if the file_path points a cli
                   archive. The value is the name of the script contained in a
                   cli archive to execute. If not specified, defaults to
                   'undeploy.scr'. All paths in the scripts are relative to the
                   root directory in the cli archive. The script is executed as
                   a batch.

Standalone Mode

Domain Mode

Connect to the domain controller.

deploy /loca/path/to/the/applicaton/artifact/test.war [destination]

where destination can be:

  • --all-server-groups
  • --server-groups=...