Difference between revisions of "Deprecated: Cross Platform App Deployment with Lianja"
Yvonne.milne (Talk | contribs) (→Web Apps) |
Yvonne.milne (Talk | contribs) (→Overview) |
||
Line 10: | Line 10: | ||
The [[#Deploy Workspace|Deploy Workspace]] is used to deploy to the local [[#Lianja_App_Center|Lianja App Center deployment path]] for testing, and to a remote [[#Lianja_App_Center|Lianja App Center deployment path]] for production use. | The [[#Deploy Workspace|Deploy Workspace]] is used to deploy to the local [[#Lianja_App_Center|Lianja App Center deployment path]] for testing, and to a remote [[#Lianja_App_Center|Lianja App Center deployment path]] for production use. | ||
− | ==Web Apps== | + | ==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|Lianja Cloud Server deployment path]] using the [[#Deploy Workspace|Deploy Workspace]]. | When developing and testing your web Apps, deploy your databases and Library and [[MetaTypes]] files to your local [[#Lianja_Cloud_Server|Lianja Cloud Server deployment path]] using the [[#Deploy Workspace|Deploy Workspace]]. | ||
− | Generate the HTML5 index.html code and deploy the App's files using [[Deploying_to_Local_Directory#Deploying_Lianja_Web.2FMobile_Client_Apps|Preview live in browser]]. | + | Generate the HTML5 index.html, phone_index.html and tablet_index.html code and deploy the App's files using [[Deploying_to_Local_Directory#Deploying_Lianja_Web.2FMobile_Client_Apps|Preview live in browser]]. |
Then, when you are ready to deploy to a remote [[##Lianja_Cloud_Server|Lianja Cloud Server]], use the [[#Deploy Workspace|Deploy Workspace]] to transfer your Apps, databases and Library and [[MetaTypes]] files. | Then, when you are ready to deploy to a remote [[##Lianja_Cloud_Server|Lianja Cloud Server]], use the [[#Deploy Workspace|Deploy Workspace]] to transfer your Apps, databases and Library and [[MetaTypes]] files. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Electron Apps== | ==Electron Apps== | ||
Line 32: | Line 23: | ||
Use the [[#Deploy Workspace|Deploy Workspace]] to transfer your Apps, databases and Library and [[MetaTypes]] files to the remote production [[##Lianja_Cloud_Server|Lianja Cloud Server]]. | Use the [[#Deploy Workspace|Deploy Workspace]] to transfer your Apps, databases and Library and [[MetaTypes]] files to the remote production [[##Lianja_Cloud_Server|Lianja Cloud Server]]. | ||
− | |||
=Web App View= | =Web App View= |
Revision as of 09:28, 3 December 2020
Contents
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 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.
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.
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. |
For example, here the files will be deployed:
- using Copy (Publisher)
- to the networked drive location G:\lianja\cloudserver\tenants\public\ (Directory)
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
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.
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
Clicking Preview will allow you to check the files and destination location of the files to be deployed.
Commit
When you are ready to deploy, click the Commit button and confirm when prompted by clicking Yes.
Then click Close.
The Clear button clears the Deployment Files Preview and Deployment Transfer 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.
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.
Clicking the Preview changes headerbar toolbutton will allow you to check the files and destination location of the files to be deployed.
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.
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'. 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'. |
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
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 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.
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.
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.
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.
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
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.
When the copy is complete, the App is now ready to build with Electron message will be displayed.
The template files can be edited.
From the Files pulldown, select the template files you want to edit in a popup editor.
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.
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())
When building in Release mode, the release-main.js file is used.
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
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
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.
Your App will be displayed in a popup window.
Log in as usual.
And test your App.
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 | /Users/<username>/Library/Application Support/Lianja/cloudserver/tenants/public/wwwroot/apps Note: /usr/local/lianja/cloudserver is a symbolic link to /Users/<username>/Library/Application Support/Lianja/cloudserver |
Databases | /Users/<username>/Library/Application Support/Lianja/cloudserver/tenants/public/data Note: /usr/local/lianja/cloudserver is a symbolic link to /Users/<username>/Library/Application Support/Lianja/cloudserver |
Library | /Users/<username>/Library/Application Support/Lianja/cloudserver/tenants/public/wwwroot/library Note: /usr/local/lianja/cloudserver is a symbolic link to /Users/<username>/Library/Application Support/Lianja/cloudserver |
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 | /Users/<username>/Library/Application Support/Lianja/cloudserver/tenants/public/apps |
Databases | /Users/<username>/Library/Application Support/Lianja/cloudserver/tenants/public/data |
Library | /Users/<username>/Library/Application Support/Lianja/cloudserver/tenants/public/library |