The script appcreatefromconfig.py is used to create a new application on the server.

The command line

A script that create a new deserver definition and upload the application if needed.

Parameters:

configpath
The path to a JSON formatted config files that is used for creating the application on the server
[deploymentserver] The server we want to deploy to.
[un] Username for logging in to your deployment server
[pw] Password for logging in to your deployment server
[name] The name of the definition to use on the server

Config key used:

dname string The name given to definition on the DEDS server.This can be overridden by the script.
deploymentserver string The server we want to deploy to. This will only be used it not given by script.
Ex. http://127.0.0.1:81 for local host on port 81.
dkey string Server key that can be used for operations instead of a username password pair. The username password is only used to fetch this key from the server.
username string Username for logging in to your deployment server. This will only be used it not given by script.
partof string The name of the app on server that this one is part of. A key with "dpartof" will be added to this and the one that this connects to are given a addtion to the "down" array.
password string Password for logging in to your deployment server. This will only be used it not given by script.
serverdef string the part or rdrrXaaa.ini that have the server settings
staticfiles string where the static files are merged from with the database part of the server. If blank this is the same as repo path. If relative, this will be a directory under the app
webserver string the name used of the webserver to the external world. In IIS it is called the binding. In DNS it is the A name.
Ex. www.example.com
repopath string Path to local repo to update from
reponame string The name of the local repo
repoun string user name for local repo
repopw string password for local repo

Config used by apps that are standalone or own others

dpappcommandsafter list A list or arrays with command to run after all other jobs has been done
Ex. [["createfolder", "log"]]
dpappcommandsbefore list A list or arrays with command to run before all other jobs has been done
Ex. [["deletefolder", "log", "recursive"]]
dbappexcludefiles list A list of relative files that are being excluded from the file list of the repo. This list is local and not used by any other apps.
dbappexcludepaths list A list of relative paths that are being excluded from the handling of repo files. This list is local and not used by any other apps.

Config used by apps that has partof

dpartof string Tell what application this app is dependent on and that will generate this apps definitions. When you are part of another application, you list what you own (and by that will update or replace) instead of updating all but your exclude lists.
owneroffiles list This is a list of the files that others apps in the tree should put in their exclude files lists. If you application is a partof application, these are the files that are updated and compared.
ownerofforms list This is a list of the forms this deployment definition owns. It is used by a general update to exclude frm files from the update by looking up the filenames when other owns the forms. Who owns what is determined by looking at the 'down' and 'dpartof' list and reverse the forms owned by the others. The form is then added to the update list as [formname,ownername,'Nothing'], and then the frm file is added to the upload exclude list. For all forms not added to this list you will get a [fromname,'Development','Replace'] if you are the owner of the application (ie. do have own list but no partof in your config). If you are a partof a other application, there are the only forms you will update.
ownerofpaths list A list of directories that others should put in their exclude paths list. If you application is a partof application, these are the directories that are updated and compared.
owneroftables list This is a list of the tables with special handling by this definition. It consist of a list of list where the inner list have ['tablename','ownername','todo']. The todo will hold 'Replace' or 'Nothing' where 'Nothing' means ignore this table all together. No definition update or copy action done. The 'Replace' mean replace tdf, data and frm and patch Application Objects and RDRRxAAA.RDR. Owner name is usually 'Development' or 'Independent' but can also be the name of the owning deployment def. 'Development' means the current defs owner and 'Independent' means stay away as the instance is unique for the deployed application. If you are a partof a other application, these are the only tables you will update. The list will then have a extra setting for Diff for updating the TDF in addition to Replace and Nothing.

Examples

{
        "dname" : "myapp",
        "deploymentserver" : "http://127.0.0.1:81" ,
        "repopath" : "C:\\Data\\myapp",
        "reponame" : "MyApp",
        "dbappexcludepaths" : ["log", "tosubmit", "upload"],
        "dpappcommandsafter" : [["foldercreate", "log"],["foldercreate", "tosubmit"],["foldercreate", "upload"]]
}

An example config that is standalone

What is done when creating a new app

First a webappconfigcreate is called with a uploaded new settings file and a user name and password. 

The user name and password is tested and a "result" : "Denied" is returned if they are wrong. 

If all is OK:

Test for dpartof and add that you are a sibling to the named app you are part of. If app do not exist return "Failed" without creating app def

'drepopath' is created based on name and global deserverapps that is the path set to where server app should be stored. Default is C:\ProgramData\DataEase\DEDS\deserverapp but this can be changed in DEDS settings.

'dappdir' is set to drepopath as generated on the server

'dstaticfiles'  are set to staticfiles or not set if staticfiles in not set

'dserverdef' is set to same as 'serverdef' or default 'server' in not set

"dserverkey" is created, stored in config and returned in result as "iiskey".

'fcgiport' is set to 'lastusedfcgiport' + 1 and deds config is updated.

config is created in C:\ProgramData\DataEase\DEDS\TheDeployed with [name].config

Return {"result" : "OK", 'appsetting': new config, 'iiskey' : the new key generated}

Then do dbexist to check if app already exist and fail if it do

Upload all files not in exclude lists

copy all files to repo folder

create start app script

create service for web app

create site for web ap

start site for web app