This documentation is for WSO2 App Factory 2.0.0. View documentation for the latest release.
Skip to end of metadata
Go to start of metadata

Introduction

The previous section, explained about configuring the Lifecycle for an application with various stages. This section focuses on how to add a new "Stage" to your system. Generally stages that are associated in an application creation - release lifecycle are "Development", "Testing" and "Production". However depending on the organization or business type, the stages can differ. Similarly the resource allocations, permissions and other configurations may change as well. 

You can define the stage details of your preference, inside the <DeploymentStage name=""> element in <AF_HOME>/repository/conf/appfactory/appfactory.xml file. 

Sample configuration

Following sample code explains how to add the Testing stage as a deployment stage:

<DeploymentStage name="Testing">
	<Deployer>
		<ApplicationType name="*">
			<ClassName>org.wso2.carbon.appfactory.jenkins.deploy.S2Deployer</ClassName>
			<Endpoint>https://sc.s2.staging.appfactorypreview.wso2.com:9445/services/</Endpoint>
			<RepositoryProvider>
				<Property name="Class">org.wso2.carbon.appfactory.tenant.roles.S2Integration.GITBlitBasedGITRepositoryProvider</Property>
				<Property name="BaseURL">http://gitblit.s2.wso2.com:80/</Property>
				<Property name="URLPattern">{@application_key}/{@stage}/as</Property>
				<Property name="AdminUserName">admin</Property>
				<Property name="AdminPassword">admin</Property>
			</RepositoryProvider>
			<Properties>
				<Property name="minInstances">1</Property>
				<Property name="maxInstances">1</Property>
				<Property name="shouldActivate"></Property>
				<Property name="alias">astest</Property> 
				<Property name="cartridgeType">astest</Property> 
				<Property name="repoURL"></Property>
				<Property name="dataCartridgeType"></Property>
				<Property name="dataCartridgeAlias"></Property>
			</Properties>
		</ApplicationType>
	</Deployer>
	<AllowDirectDeploy>true</AllowDirectDeploy>
	<AutomaticDeployment enabled="false">
		<PollingPeriod>6</PollingPeriod>
	</AutomaticDeployment>
	<DeploymentArtifact>
		<TriggerBuild>
			<ArtifactStoragePolicy>Tagged</ArtifactStoragePolicy>
		</TriggerBuild>
	</DeploymentArtifact>
	<Promote>
		<DeploymentPolicy>Promoted</DeploymentPolicy>
		<TargetStage>Production</TargetStage>
	</Promote>
	<Demote>
		<TargetStage>Development</TargetStage>
	</Demote>
	<CreateArtifact>UserInput</CreateArtifact>
	<ProcessEndPoint>https://appfactorypreview.wso2.com:9443/services/DeployToStage</ProcessEndPoint>
	<DeploymentServerURL>https://appserver.test.appfactorypreview.wso2.com:9447/services/</DeploymentServerURL>
	<MountPoint>test</MountPoint>
	<BaseAccessUrl>http://appserver.test.appfactorypreview.wso2.com/</BaseAccessUrl>
	<Buildable>false</Buildable>
	<StorageServerUrl>https://appfactorypreview.wso2.com:9480/services/</StorageServerUrl>
	<RssName>Testing</RssName>
</DeploymentStage>

The elements of the sample configuration are explained below. You can use this information to edit the file according to your requirements.

XML elements of the sample code

Element NameDescriptionTypeDefault ValueFixed ValuesMandatory/Optional

<DeploymentStage name="">

Specifies new life cycle stage that is defined in life cycle config file (configurations.xml).

String   

<Deployer>

Defines application types and its repository configuration. Deployer can be either S2 or Carbon4. Carbon4-based deployer only contains <ClassName> tag inside <Deployer>. S2 contains all other tags.

    

 

<ApplicationType name="">

Specify allowed application type, which can be deployed.

String   

 

<ClassName>

Class path to application type deployment's implementation class.

String   

 

<Endpoint>

Staging deployment endpoint URL.

String   

 

<RepositoryProvider>

Credentials of repository provider.

    
 

<Properties>

Property related to cartridge needed to subscribe.

String   

<AllowDirectDeploy>

Enable or disable Deploy button.

    

<AutomaticDeployment enabled="">

Enable or Disable auto-deployment.

Boolean true, false 

 

<PollingPeriod>

Polling period (in minutes) to the repository, to check for the new commits. Default this has been configured only for the "Development" Stage, which is the most common case. 

Integer   

<AutomaticDeployment enabled="">

Define whether to deploy "Latest" or "Marked" artifact.

Boolean true, false 
<DeploymentArtifact>     
 <ArtifactStoragePolicy> String   

<Promote> and <Demote>

 

Transition event which is specified in App Factory life cycle configuration file.

    
 

<DeploymentPolicy>

Tagged/ Promoted artifact will be deployed to the promoted stage.

    

 

<TargetStage>

Define target stage when transition state is invoked.

    
<CreateArtifact> String   

<ProcessEndPoint>

Specify end point service URL to call when deploy button is clicked.

String   

<DeploymentServerURL>

Deployment server URL to deploy artifact.

String   
<MountPoint>Registry mount point for other service (eg: appserver) for property management in appfactory.String   

<BaseAccessUrl>

Base access URL for application launch.

String   

<Buildable>

Configure the Lifecycles such that the applications in that lifecycle can/cannot be build.

Boolean true, false 

<StorageServerUrl>

Base service URL for storage.

String   

<RssName>

RSS name of given deployment stage.String   
  • No labels