Difference between revisions of "Deprecated: Cross Platform App Deployment with Lianja"

From Lianjapedia
Jump to: navigation, search
(Electron Build)
Line 1: Line 1:
''Under Construction''
 
 
 
=See Also=
 
=See Also=
 
[[A Guide to Deploying Web Apps]], [[:Category:Deployment|Deployment (Category)]], [[Deploying to Local Directory]], [[Understanding Live Preview in Lianja]]
 
[[A Guide to Deploying Web Apps]], [[:Category:Deployment|Deployment (Category)]], [[Deploying to Local Directory]], [[Understanding Live Preview in Lianja]]

Revision as of 12:50, 6 December 2017

See Also

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

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 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 code and deploy the App's files using the Deploy toolbutton in Web App View.

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.

Mobile Apps

When developing and testing your PhoneGap mobile Apps for iOS or Android, deploy your databases and Library and MetaTypes files to your local Lianja Cloud Server deployment path using the Deploy Workspace.

You can then use Tablet App View and/or Mobile App View to interact with your App, preview your App in a browser and start the LiveView Server on your development machine allowing you to connect and run your App from a remote mobile device. See Understanding Live Preview for detailed information on these.

Use the PhoneGap Cloud Build Service directly from the Build workspace to create your Lianja PhoneGap App for use with your local development machine Lianja Cloud Server for testing and then for the remote production Lianja Cloud Server.

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

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.


Web App View

For web Apps, use Web App View to deploy your App for your local Lianja Cloud Server. This generates the HTML5 index file and copies the App's files to the deployment path.

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

Deploy and Preview



Click the toolbutton in the header to access Web App View.

Click Deploy in Web App View to generate the HTML5 index file and copy the App's files to the deployment path.

For testing purposes, click Preview to preview your App live in your default browser.


See Understanding Live Preview in Lianja for more on using Preview in Web App View.


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.
App Deployment Settings: COPY




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: SFTP




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


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

Quick Deploy




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

The first step in using Quick Deploy is Setup.


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.

Quick Deploy Setup: Deploy Workspace



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

While in the Deploy workspace, you can change the Deployment Settings 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.


Preview

Quick Deploy: Preview



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


Commit

Quick Deploy: Commit


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

Then click Close.


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.

Deploy Workspace: Select Files



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

Note that if your Apps are in a Lianja Project, checking the box next to the Project name will automatically select all files associated with that Project in the Deployment files explorer tree.

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


Deploy Workspace: Preview Changes



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


Deploy Workspace: Commit Changes



Click the Commit changes headerbar toolbutton when you are ready to deploy and confirm when prompted by clicking Yes.


Deployment Settings

As mentioned above, the deployment settings default to those in the App Settings. These can be changed in the Deploy workspace and additional file permissions specified.

Deploy Workspace: Deployment Settings



Click New to create a new Deployment Settings profile.

Enter a name for the profile then fill in the settings.

Settings descriptions are listed in the tables below.

Once complete, click Save.

The new settings profile can be selected from the Favorites combobox at any time in the future to override the App Settings defaults.


Server details

Setting Description
Server The server IP address or nodename where the App will be deployed, e.g. localhost or myserver.mydomain.com.
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.
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'.
Group The group to be set for the deployed files, e.g. 'apache'.
Permissions The permissions to be set for the deployed files, e.g. '766'.

Publisher details

Setting 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.

System Database

Deploy 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.


PhoneGap Build

Use the PhoneGap Cloud Build Service directly from the Build workspace to create your Lianja PhoneGap App for use with your local development machine Lianja Cloud Server for testing and then for the remote production Lianja Cloud Server.

For information on registering for the Adobe PhoneGap Cloud Build Service and creating the required certificates / signing keys, please see PhoneGap Cloud Build Service.

Deploy App, data, Library and MetaType files using the Deploy Workspace before running your Lianja PhoneGap App.

Select the Build workspace in the App Builder then select the PhoneGap Build Tab and specify the build settings as described. Notice that you can manage existing builds by specifying your PhoneGap Build Account Credentials then clicking the Refresh button. The status of your existing builds will be displayed. The Adobe PhoneGap Build Service limits you to 25 builds. You need to delete older builds or the builds will eventually be rejected. You can delete individual older builds by clicking Delete on the left hand side column of the build information or click the Purge button to delete all your builds.

PhoneGap Build


PhoneGap App Settings

Create some new PhoneGap App settings by clicking New specifying a unique Application ID and then specifying the settings in the tabs as shown below.

App Options


The Base URL is important as this will be embedded into your App when you build it. This should be the base URL of your Lianja Cloud Server. If you are testing your App on a mobile device then this will default to the IP address of your development machine e.g. http://192.168.1.5:8001/.

Further configure your App in the App Preferences and App Plugins tabs.

App Preferences


App Plugins


Click Save when the App Options, App Preferences and App Plugins configuration is complete.

Build

After selecting the PhoneGap Build Service Tab, select the Device Type and the Operating System then click the Build button.

Lianja App Builder will dynamically generate the PhoneGap directory structure needed to build the App and will request a remote build using the Adobe PhoneGap Build service. The PhoneGap Build Log will provide progress messages during the build process so you can see what is going on.

PhoneGap Build Service


If you get an unexpected error message (e.g. ones that you can't fix by correcting your Account Credentials), please check the PhoneGap Build Troubleshooter for ones we have encountered and their solutions.

Your Apps

If the build is successful (as detailed in the PhoneGap Build log) click the VIEW WEBSITE button and then select Apps. You will need to login with your Adobe PhoneGap Build credentials to do this.

Once logged in, you can also use the PhoneGap workspace VIEW APPS button to go directly to your apps. Click APP SIGNING or APP PLUGINS for more online information and SERVCE STATUS to check the status of the PhoneGap Build Service.

PhoneGap Workspace buttons


Your Apps


Scan QR-Code

With the Apps page displayed, open the QR-Code Reader App on your mobile device and scan the QR-Code for the App that you have just built. You will be asked if you want to download it, answer yes, then yes again to install it.

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

Mac

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

Lianja App Center

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

Mac

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