deployment

project-build-environment grammar version 41

  1. Deployment
    1. Application Servers
    2. External Systems
    3. Systems
      1. Configuration
      2. Instance Data
      3. Schedule
  2. Component rules

Deployment


In order to run an Alan application it needs to be deployed by an Alan Application Server. A deployment.alan file contains instructions for the deployment, such as the source of the initial data and configuration.

Application Servers

The application-servers section lists all the Application Servers needed for the deployment. The Application Server performing the deployment can be referenced with the keyword local.

'application servers': [ application-servers ] dictionary {
	'type': [ : ] stategroup (
		'remote' {
			'socket': component 'tcp socket'
		}
		'host' { [ local ] }
	)
}

External Systems

The wiring.alan file declares which external sources your applications require. In the deployment.alan, you need to provide the exact location of these sources. For specifying a source location, you can use

'external systems': [ external-systems ] dictionary {
	'mapping type': [ : ] stategroup (
		'static' {
			'routing': stategroup (
				'direct' {
					'socket': component 'tcp socket'
				}
				'application server' {
					'server': reference
					'stack': [ / ] text
					'route': [ / ] text
				}
			)
		}
		'dynamic' {
			'targets': dictionary {
				'server': [ = ] reference
				'stack': [ / ] text
				'route': [ / ] text
			}
		}
	)
}

Systems

The systems section provides deployment specific information for each system mentioned in a wiring.alan file. Depending on the System Type, a system may require additional configuration, instance data, or a schedule.

Configuration

For systems requiring additional configuration, you can either

Instance Data

Some systems require data to function (instance data). To provide data for a system, you can either

At deploy time, transformations can be applied to your instance data. A transformation can be

Schedule

Some systems require a schedule to perform tasks at specific moments in time.

'systems': [ systems ] dictionary {
	'configuration': [ configuration: ] group {
		'base': stategroup (
			'template' {
				'template': reference
			}
			'custom' { [ custom ] }
		)
		'options': dictionary {
			'value': [ = ] component 'value switch'
		}
	}
	'instance data': stategroup (
		'yes' { [ instance-data: ]
			'source': stategroup (
				'local' { [ local ] }
				'remote' { [ from ]
					'server': reference
					'stack name': [ / ] text
					'system name': [ / ] text
				}
			)
			'transformations': group { // TODO: dynamic-order
				'migrate': stategroup (
					'yes' { [ @migrate ] }
					'no' { }
				)
				'convert': stategroup (
					'yes' { [ @conversion: ]
						'conversion': reference
					}
					'no' { }
				)
			}
		}
		'no' { }
	)
	'schedule': stategroup (
		'yes' { [ schedule: ]
			'schedule': component 'schedule'
		}
		'no' { }
	)
}

Component rules

'tcp socket' {
	'host': text
	'port': integer
}
'value' {
	'data type': stategroup (
		'choice' {
			'type': stategroup (
				'multiple' {
					'choices': [ [, ] ] dictionary { }
				}
				'single' {
					'choice': reference
				}
			)
		}
		'number' {
			'value': integer
		}
		'text' {
			'value': text
		}
	)
}
'value switch' {
	'type': stategroup (
		'singular' {
			'is set': stategroup (
				'yes' {
					'value': component 'value'
				}
				'no' { [ none ] }
			)
		}
		'plural' {
			'values': [ (, ) ] dictionary {
				'value': [ = ] component 'value'
			}
		}
	)
}
'schedule' {
	'trigger': stategroup (
		'every day' { [ every day ]
			'trigger': stategroup (
				'every hour' { [ every hour ]
					'every': component 'minute list'
				}
				'select hours' {
					'every': component 'hour list'
				}
			)
		}
		'select days' { [ every ]
			'sunday': stategroup (
				'yes' {
					'day': [ Sunday ] component 'day'
				}
				'no' { }
			)
			'monday': stategroup (
				'yes' {
					'day': [ Monday ] component 'day'
				}
				'no' { }
			)
			'tuesday': stategroup (
				'yes' {
					'day': [ Tuesday ] component 'day'
				}
				'no' { }
			)
			'wednesday': stategroup (
				'yes' {
					'day': [ Wednesday ] component 'day'
				}
				'no' { }
			)
			'thursday': stategroup (
				'yes' {
					'day': [ Thursday ] component 'day'
				}
				'no' { }
			)
			'friday': stategroup (
				'yes' {
					'day': [ Friday ] component 'day'
				}
				'no' { }
			)
			'saturday': stategroup (
				'yes' {
					'day': [ Saturday ] component 'day'
				}
				'no' { }
			)
		}
		'never' { [ never ] }
	)
}
'day' {
	'every': component 'hour list'
}
'hour list' {
	'at hour': [ at ] integer
	'at minute': [ : ] integer
	'has tail': stategroup (
		'yes' {
			'tail': component 'hour list'
		}
		'no' { }
	)
}
'minute list' {
	'at minute': [ at ] integer
	'has tail': stategroup (
		'yes' {
			'tail': component 'minute list'
		}
		'no' { }
	)
}