Cross Platform App Deployment with Lianja v6

From Lianjapedia
Jump to: navigation, search

See Also

A Guide to Deploying Web Apps, Deployment (Category), Deploying to Local Directory, Understanding Live Preview

Overview

From the Lianja App Builder on Windows, Linux or macOS, you can develop desktop, web or mobile Apps and deploy them directly from the IDE for Windows, Linux, macOS, iOS or Android.

Desktop Apps

For desktop Apps, use the Deploy Workspace to transfer your Apps, databases and Library and MetaTypes files.

The Deploy Workspace is used to deploy to the local Lianja App Center deployment path for testing, and to a remote Lianja App Center deployment path for production use.

Web and Mobile Apps

When developing and testing your web Apps, deploy your databases and Library and MetaTypes files to your local Lianja Cloud Server deployment path using the Deploy Workspace.

Generate the HTML5 index.html, phone_index.html and tablet_index.html code and deploy the App's files using Preview live in browser.

Then, when you are ready to deploy to a remote Lianja Cloud Server, use the Deploy Workspace to transfer your Apps, databases and Library and MetaTypes files.

Electron Apps

Web and mobile Apps can also be packaged as Electron Apps to run as self-contained clients on Windows, Linux and macOS accessing a Lianja Cloud Server on Windows, Linux or macOS.

Use Electron Build directly from the Build workspace to package your Lianja Electron App.

Use the Deploy Workspace to transfer your Apps, databases and Library and MetaTypes files to the remote production Lianja Cloud Server.

Preview live in browser

For web and mobile Apps, use Preview live in browser to deploy your App for your local Lianja Cloud Server. This generates the HTML5 index file, phone_index.html and tablet_index.html code and copies the App's files to the deployment path.

Deploy your database, Library and MetaTypes files to your local Lianja Cloud Server using the Deploy Workspace before running Preview live in browser.

Preview live in browser


To deploy your Apps, databases and Library and MetaTypes files to a remote location, using the Deploy workspace.

Deploy Workspace

You can go directly to the Deploy workspace via the system menu or Modebar, or use the Quick Deploy toolbutton in the headerbar of the Pages and other workspaces.

Quick Deploy

Quick Deploy can be run while the App is open. Quick Deploy automatically saves and restores the environment, closing the database and tables for the deployment then reopening them when the operation is complete.

Quick Deploy defaults to using the App Deployment Settings:

Attribute Description
Publisher The way to publish the Apps (Copy | SFTP | Custom).
Publisher path The optional full path of the publisher program, e.g. /usr/bin/rsync.
Publisher arguments The optional arguments to the publisher program, e.g. -avc for rsync.
Server The server IP address or nodename where the App will be deployed, e.g. localhost or myserver.mydomain.com.
Directory The root lianja directory on the LAN or server where the Apps will be deployed.
Build an installer Build an installer for Windows desktop deployment (True | False).
Username The optional username to authenticate with the remote server.
Password The optional password to authenticate with the remote server.
Private key (.pem file) The (optional) private key (.pem file) to authenticate with the remote server.

For example, here the files will be deployed:

- using Copy (Publisher)

- to the networked drive location G:\lianja\cloudserver\tenants\public\ (Directory)

App Deployment Settings: COPY


And another example, here the files will be deployed:

- using SFTP (Publisher)

- to the server on 192.168.80.133 (Server)

- to the server location /opt/lianja/cloudserver/tenants/public/ (Directory)

- logged in as root (Username)

- the password (Password) is not specified, but a prompt dialog will be displayed

App Deployment Settings: SFTP


Note that the Directory location is the root location. Files will be deployed to the sub-directories of this location. The trailing directory separator ('\' or '/') should be included.

Publisher path and Publisher arguments are only required when using a Custom Publisher.

Setup

Click the Quick Deploy toolbutton in the headerbar to open the dialog.

The first step in using Quick Deploy is Setup.

Quick Deploy


Clicking the Setup button takes you into the Deploy workspace. Here you can select the databases, Apps and Library files that will be included in your deployment.

Check the box next to the databases, Apps and Library files to be deployed.

While in the Deploy workspace, you can change the Deployment configuration to specify an alternative location or additional options as required.

Then switch back to the Pages workspace and reopen the Quick Deploy dialog using the toolbutton in the headerbar.

Note that while this Lianja App Builder session is running your deploy setup will remain active until you change it.

Quick Deploy


Preview

Clicking Preview will allow you to check the files and destination location of the files to be deployed.

Quick Deploy


Commit

When you are ready to deploy, click the Commit button and confirm when prompted by clicking Yes.

Then click Close.

Quick Deploy


The Clear button clears the Deployment/Build Files Preview and Deployment/Build Log output windows.

Deploy Workspace

As mentioned above, you can go directly to the Deploy workspace rather than use Quick Deploy.

To deploy in the Deploy workspace, there should be no App or database open.

From the Deploy workspace you can select and deploy files or build a package of files and optionally deploy the package.

Anatomy of the Deploy Workspace

Anatomy of the Deploy Workspace


  • Deployment Files: Expand or collapse the tree as required and check the box next to individual files or groups of files to select them for deployment.
  • Deployment configuration: Specify the deployment target (defaults to Local / previous App Settings)
  • Package details: Optionally build a package of your selected files for deployment and add/exclude files.
  • Deployment/Build Files Preview: List the files that will be packaged/deployed (prior to commit).
  • Deployment/Build Log: List the files packaged/deployed (on commit).

Deployment configuration

This is where you specify the deployment target.

Button Description
Target Name of target. The default target is 'Local' and this is configured in the App Settings; unlike other targets it cannot be edited here. Existing targets can be selected from the pulldown.
New Create a new target.
Edit Edit the currently selected target.
Delete Delete the currently selected target.
Deploy Deploy to the currently selected target. If Package details have been specified and the target Publisher is http or https, the package will be built before deployment.
Save Displayed in edit mode. Save the currently selected target and exit edit.
Cancel Displayed in edit mode. Cancel any changes to the currently selected target and exit edit.

The Server details options depend on the Publisher type:

Publisher Description
Copy Copy individual files to a LAN or local directory.
SFTP Copy individual files to a remote SFTP server.
http Build a package and upload it to a Lianja Cloud Server via http.
https Build a package and upload it to a Lianja Cloud Server via https (Apache/IIS).
Custom Copy individual files to a remote server using a custom protocol, e.g. rsync.

Copy

Setting Description
Directory The root lianja directory on the LAN or server where the Apps will be deployed.

Select the files to deploy from the Deployment files tree then click the Deploy button or Commit Changes toolbutton.

Copy


SFTP

Setting Description
Server The server IP address or nodename where the App will be deployed, e.g. localhost or myserver.mydomain.com.
Username The username to authenticate with the remote server.
Password The optional password to authenticate with the remote server.
Private key (.pem file) The (optional) private key (.pem file) to authenticate with the remote server.
Directory The root lianja directory on the LAN or server where the Apps will be deployed.
Owner The owner to be set for the deployed files, e.g. 'apache'. This is currently ignored.
Group The group to be set for the deployed files, e.g. 'apache'. This is currently ignored.
Permissions The permissions to be set for the deployed files, e.g. '766'.

Select the files to deploy from the Deployment files tree then click the Deploy button or Commit Changes toolbutton.

SFTP


http/https

Setting Description
Server The server IP address or nodename for the Lianja Cloud Server where the App will be deployed.
The port can be postfixed if required, e.g. ':8001'.
Username The username to authenticate with the remote server.
Password The password to authenticate with the remote server.
API key The API key to authenticate with the remote server.
This is set in the Lianja Server Manager on Windows or in the lianja.conf configuration file on Linux or macOS.

There are two ways to specify the files to be included in the package for deployment. Either edit the configuration and type the filenames in the Files to deploy panel:

HTTP/HTTPS


Bm-noteicon.png

Note the use of special filename prefixes such as 'app:/', '!' to exclude a file and '*' wildcards.

Or select the files in the Deployment files tree, then click the Add Files button:

HTTP/HTTPS


Click the Deploy button to build the package and deploy it:

HTTP/HTTPS


Custom

Setting Description
Path The optional full path of the publisher program, e.g. /usr/bin/rsync.
Arguments The optional arguments to the publisher program, e.g. -avc for rsync.

Select the files to deploy from the Deployment files tree then click the Deploy button or Commit Changes toolbutton.

System Database

The system database holds the definitions for Users and Roles, Row Level Security and Dynamic Data Masks.

Make sure the system database is included in the deployment.

Deploy System Database


Electron Build

With Electron you can package up a Lianja Web/Mobile App into an executable for Windows, MacOS or Linux. This is similar to the way in which PhoneGap operates insofar as the Apps are visually designed in Lianja and can include TypeScript and/or JavaScript custom code, but the target is a desktop application which can be submitted to the Windows and MacOS App stores.

After creating your Lianja Web/Mobile App, you build the Electron executable in the Electron tab in the Build workspace.

Electron Apps require a connection to Lianja Cloud Server.

See also here including notes and system requirements.

Configuration

Electron Tab in Build Workspace: Init


When your App is ready to build, switch to the Build workspace.

The first step is to click the Init button.

This copies the template Electron files to the electron sub-directory of your App.


Electron Tab in Build Workspace: Init Complete



When the copy is complete, the App is now ready to build with Electron message will be displayed.


Electron Tab in Build Workspace: Files



The template files can be edited.

From the Files pulldown, select the template files you want to edit in a popup editor.


Electron Tab in Build Workspace: Files



Edit the package.json file to define the configuration of your Electron App.

The template file shows the format required.

Note: the version refers to your App version.


Electron Tab in Build Workspace: Files



The debug-main.js file is used when you build in Debug mode.

It includes the instruction to automatically open the developer tools when the App is run.

(mainWindow.webContents.openDevTools())


Electron Tab in Build Workspace: Files



When building in Release mode, the release-main.js file is used.


Settings

Electron Tab in Build Workspace: Settings



Next, click New to create a new configuration then edit the Electron App Settings as required.

Specify the Lianja Cloud Server URL and any optional settings.

Then click Save to save your changes or Cancel to exit without saving.


Build

Electron Tab in Build Workspace: Build



Check that the Platform, Architecture and Config pulldowns are displaying the correct values for your intended build.

Then click the Build button to build your Electron App.


Run

Electron Tab in Build Workspace: Run



Once the Electron Build Log output window displays Build complete, click the Run button to run your App.


Note that here the App has been built in Debug mode, so the developer tools are automatically loaded.


Electron Tab in Build Workspace: Run



Your App will be displayed in a popup window.

Log in as usual.


Electron Tab in Build Workspace: Run



And test your App.


Electron Tab in Build Workspace: Run



And here's the same App built in Release mode.


Deploy

The files required to deploy your Electron App are created in:

<drive>:\lianja\apps\<appname>\electron\dist\<app>-<platformname>-<architecture>

For example, in the screenshots above the files are created in:

C:\lianja\apps\lianja_mobiledemo\electron\dist\lianja_mobiledemo-win32-ia32

Deployment Directories

Lianja Cloud Server

Using the standard installation settings, these are the Lianja Cloud Server default directories for Web/Mobile Apps:

Windows

Files Location
App C:\lianja\cloudserver\tenants\public\wwwroot\apps
Databases C:\lianja\cloudserver\tenants\public\data
Library C:\lianja\cloudserver\tenants\public\wwwroot\library

Linux

Files Location
App /opt/lianja/cloudserver/tenants/public/wwwroot/apps
Databases /opt/lianja/cloudserver/tenants/public/data
Library /opt/lianja/cloudserver/tenants/public/wwwroot/library

macOS

Files Location
App /Users/Shared/Lianja/cloudserver/tenants/public/wwwroot/apps
Databases /Users/Shared/Lianja/cloudserver/tenants/public/data
Library /Users/Shared/Lianja/cloudserver/tenants/public/wwwroot/library

Lianja App Center/Lianja SQL Server

Using the standard installation settings, these are the Lianja App Center default directories for Desktop Apps:

Windows

Files Location
App C:\lianja\cloudserver\tenants\public\apps
Databases C:\lianja\cloudserver\tenants\public\data
Library C:\lianja\cloudserver\tenants\public\library

Linux

Files Location
App /opt/lianja/cloudserver/tenants/public/apps
Databases /opt/lianja/cloudserver/tenants/public/data
Library /opt/lianja/cloudserver/tenants/public/library

macOS

Files Location
App /Users/Shared/Lianja/cloudserver/tenants/public/apps
Databases /Users/Shared/Lianja/cloudserver/tenants/public/data
Library /Users/Shared/Lianja/cloudserver/tenants/public/library