Results 1 to 3 of 3

Thread: [Answers] Deployment-1

  1. #1
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135

    [Answers] Deployment-1

    You have to download the Lianja App Center separately and put it in the .\redist\ folder if you want to build an installer package.



    When deploying to a client site, you deploy the system database to include the specified users and their passwords.

    The App Center is the desktop client. On a new installation it has a default username/password of admin/admin.

    To run the development environment, you need to run the App Builder. By default you will be logged in automatically. You can also use the in-built admin/admin login. The admin account can be changed, and other users added, in the Users Workspace



    Can you submit a ticket and attach the output
    and the full deployment log details when you try to deploy?
    Have you previously deployed the database or is this the first time?
    I had a failure the other day when I forgot I already had the database (in the deployed location) open in a client.



    Please upgrade your Lianja App Builder to the v1.1.2 release. Download the Lianja App Center 1.1.2. Do not install the Lianja App Center, but place the downloaded file in the drive:\lianja\redist\ directory.



    The Template Installer script includes commands to install the Lianja App Center if it is not already installed. This is discussed at the beginning of this Forum thread. You do not have to include the Lianja App Center in your Installer if your users already have it.
    If the Lianja App Center is included in the Installer, it should be the same version as your Lianja App Builder where you do your development. When you download the Lianja App Builder, download the Lianja App Center too, but do not install it. Just put the Lianja App Center download in your drive:\lianja\redist\ directory.



    The template installer defaults to not installing the Lianja App Center if it is already installed, but you can change this. If I comment out the lines, as in the screenshot, the Lianja App Center will be installed.






    So, before you deploy your App, make sure you check the 'Published' attribute in Settings, save the App and close it then Deploy.
    Once published and deployed your App will be available in the App Center. Fire up the App Center from the desktop shortcut, login (remember default admin/admin) and you will see your App. Back in the App Builder in the Settings, you can also configure Tile information for the App.



    All topics in [Answers] alphabetically: http://www.lianja.com/community/show...ll=1#post12352
    This same topic is extended to another thread: http://www.lianja.com/community/show...s-Deployment-2
    Last edited by josipradnik; 2016-10-24 at 03:22.

  2. #2
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Q:
    In the app builder when I click Web App View my app opens in dev view-mode and when I click 'Preview' it opens in the browser as it would appear at runtime.
    For this to work I assume then that clicking 'Preview' actually deploys the app to the local server - but ONLY the app, db and other files need to be deployed manually.
    If this is correct then what is the purpose of the 'Deploy' button on the Web App View?
    A:
    Deploy deploys the App without opening your default browser.
    Preview deploys and opens your default browser.



    Q:
    I am having difficulty deploying my first app to a windows client. I have downloaded the windows installer, created an installer file, chose my app and database and it completes the compile without errors. Upon launch, the install program runs and completes, but when I go to the app center I cannot log on as an admin.

    I initially tried the default password, but then thought I might have changed it so I changed it again in the app builder and reinstalled. Still cannot gain access. I then had a second log in created for a different user with the same roles as the admin. This one I can log into but it give me a notice that it has no published apps available.

    Any suggestions on 1 how to gain admin access to the app center and determine if the app actually installed?
    I have compiled the program and installed it into the app center without errors in the process.
    All data files appear to be where the installer said it would put them, but I get the errors below upon launch of the app in the app center. and if I try to open a record, it says no table found.
    A:
    On the client machine where you have run your installer, have a look at the drive:\lianja\log\log.txt file. This will include the dataDirectory and other directory settings it is using.
    Check that this directory contains the databases that you are expecting.
    You can also use the --debug command line switch in your Lianja App Center shortcut, e.g. if installed on C:
    C:\lianja\bin\lianjaruntime.exe --debug
    This will then output debugging information to the debug.txt and/or debug_client.txt files in the C:\lianja\debug directory.



    Q:
    I tried to deploy my App locally on my desktop. The creation of the exe file went well and the installation of the package. However when I created the shortcut and tried to run the app it failed.
    I went back to my APP builder to try to access my app; it failed also. Checking database directory, I saw that 2 tables missed and I restored them from my backup.
    But unfortanatly when I restart my APP builder, it failed again and 1 of the two tables disappeared.

    Table missed in the directory as if it was deleted; only the index file (dbx) remained. This issue happened every time the app failed.
    I restored it and once again the APP builder failed and everytime it failed, the table is missed.
    I restored the app from the backup I made before the deployment but the same issue persist. So in last ressort, I re-install the APP builder, but the issue is still there.
    A:
    You need to rebuild the database so that tables are included in the database catalog if you have copied them in externally. You can issue the REBUILD DATABASE command from the Lianja/VFP command window in the Console, or use the right-click context menu in the Data workspace.

    Note: if you are running an installer on your development machine, make sure that you do not include the Lianja App Center in the installer.
    If you install the App Center on top of the App Builder, you change the Lianja root directories for data, Apps etc. Now you have the App Builder reinstalled, these will have been set back to the correct directories.
    If you just want to test your App in the App Center on your development machine, there is no need to build an installer, just deploy
    If you are testing an installer, then ideally run this on another machine or VM, but if you must test it on your development machine, it is important not to include the App Center.
    Q2:
    After I reinstall the APP builder everthing is ok now; I can use agian my app in the APP builder.
    For the deployment, I understand the mistake; I included the App center in the installer.



    Q:
    a server (file server: drive mapped to Z[IMG]file:///C:/Users/Kruno/AppData/Local/Temp/enhtmlclip/Image(3).png[/IMG]:
    some client (win)
    I did deploy the application on the server:
    Z:\Lianja\cloudserver\tenants\public\
    copying application and data
    I installed the runtime on the client.
    Then, launch:
    C:\lianja\bin>lianjaruntime -a z:\Lianja\cloudserver\tenants\public\apps\martinel li_articoli\martinelli_articoli.lianja
    I've try this:
    lianjaruntime -a --runtimedatadir Z:\Lianja\cloudserver\tenants\public\data\cogema --networkshare z:\Lianja\cloudserver\tenants\public\apps\martinel li_articoli\martinelli_articoli.lianja
    A:
    C:\lianja\bin\lianjaruntime.exe --runtimedir Z: -a martinelli_articoli
    where Z: is mapped to the parent drive or directory of the lianja directory on the server.
    or
    C:\lianja\bin\lianjaruntime.exe --tenancy Z: -a martinelli_articoli
    where Z: is mapped to the \lianja\cloudserver\tenants\public directory on the server.
    Note: --runtimedir may be deprecated in favour of --tenancy from Lianja v2.1.

    Q2:
    In this way, app and data are stored on the server. But when I run the app, is executed locally, right?
    A: Correct



    Q:
    I deployed my app on a windows server 2k8 and built the desktop installer to install on the desktop machines.
    I created a local drive Z: pointing to the shared folder on the server containing the deployed application \lianja\cloudserver\tenants\public.
    The shortcut to the application has the following command to run the application
    c:\lianja\bin\lianjaruntime.exe --tenancy Z: --app gesavoc (app name)
    The application is executed properly but I can't get the authentication screen, the main form of the application automatically.
    I deployed the system and application databases on the server and the application has the "published" and "Login required" properties are set to "true".
    A:
    The --app <appname> command line switch causes the App to be loaded without the App Center login page being displayed.
    With no switch, the user logs in then sees the App Center and all published Apps available to them.

    The switch you need to use is --loginapp <appname>. With this, the user logs in then goes straight to the App you specify without seeing any other published Apps.



    Q:
    the --runtimedir will be the same as the --tenancy parameter which use the mapped network shared folder.
    A:
    No, --runtimedir points to the root drive or directory where the lianja sub-directory contains the runtime path for Apps, Library and Data, e.g. F: (where files are located in F:\lianja\cloudserver\tenants\public\...).



    Q:
    I had to deploy my app from the laptop to my win server. I installed the APaas Dev on the server and I deployed the application in a the shared folder. So I used the server itself as the development machine and the application was deployed properly.
    I created users and roles on the server and also deployed the system and application in the server.
    Now I have to install client machines to access to the application. For this purpose I built an installer file to install the application on client machines.
    It is done but when I launched the application, it is displaying directly the starting page of the application without the authentication screen.
    I used a shortcut on the client machine with the tenancy parameter refereing to the mapped local drive.

    I would like to have my client machines display the login screen prior to launch the application main form.
    In my case files and programs are located in the server and the \lianja\cloudserver\tenants\public is shared and mapped to a local drive on client machine.
    So should I share the drive where lianja is installed in the server and map this drive also to a local disk?
    A:
    Yes, exactly.



    Q:
    when a DB is deployed from the app builder the entire database is copied in as-is (structure and data) to the cloud server. This means that if I have a live running app and I make a change to the database in app builder (eg. add a column) and I then re-deploy, this will overwrite everything in the live database?

    If this is correct then it seems that the database should actually not be part of the deployment at all, but rather it should be created completely in code which would run the startup prg. I had (incorrectly, it seems) assumed that deployment of a database would sync structure changes but keep the live data intact.

    Also, what is the process to deploy to a client that is running an on-premise cloud-server? is there a package that can be sent to the remote site to update the app or similar?
    A:
    With regards to deployment, best practices dictate that you have:

    1. Development database and apps. This is where you use the app builder to build the apps with live views against the development data.

    2. Staging database and apps. This is where you deploy to from the app builder and "Preview". It's normally on the development machine.

    3. Customer deployment target at a remote site. Build an installer package using the installer of your choice. See below.

    As part of your release management, build a company branded installer, include an upgrade script as a .rsp page that upgrades the database using the functions mentioned in this thread:
    http://www.lianja.com/community/show...tabase+compare

    Alternatively if you are deploying in a public cloud such as AWS you can sftp your files up as well as your upgrade_version.rsp script then run it to update the database.
    Well, the cloud server can run rsp pages on a remote site so this is the simplest way to perform the upgrade.
    Many web based applications (e.g. CMS) perform system upgrades this way.



    Q:
    For some individual developers, its possible that they may develop and deploy on a single server (not ideal - I know).
    Or perhaps they develop and use the same box for UAT before deploying to a production server.
    I was wondering if it's possible to open the production database from inside the app builder to get all the data definitions for comparison.

    Something like
    Open database C:\lianja\cloudserver\tenants\public\data\Southwin d
    A:
    The best way to handle this is take a snapshot of your database schema at the time you release version 1. You can right-click on the database name in the data workplace and choose "Copy..." then give it a name such as:

    southwind_v10

    It is then just a matter of creating your own "diff" using the functions provided and creating an updatedb.prg script (possibly as the open database trigger from v1.0 of your database).

    Each time you release a new version that has schema changes take a snapshot...

    southwind_v11

    etc

    You then have a general updater that will modify the schema and provide continuous delivery of schema changes by generating a new updatedb.prg and replacing it in the database.

    You also have a complete history of schema changes for all versions that you have deployed.
    Thats the way I would handle schema changes onto a live site.



    Q:
    I have compiled the program and installed it into the app center without errors in the process.
    I am getting runtime errors when I launch the app from the app center. In the app builder, the app runs with out any runtime errors. It appears that the database is either unavailable or it is not pointing to the correct location since it is not loading my memory variables and when I search for a record it says no record found. I included the databases when I created the build. Is there a place to look to see if it is pointing to the correct location for the database?

    Below is the file location call out in the builder. invoice being the name of the database.
    Section -DATAFILES
    SetOverwrite ifnewer
    SetOutPath "${PRODUCT_SHAREDINSTALLDRIVE}\lianja\cloudser ver\ tenants\public\data\system"
    File /r /x *.bak "${LIANJA_INSTALLDIR}\data\system\*.*"
    SetOutPath "${PRODUCT_SHAREDINSTALLDRIVE}\lianja\cloudser ver\ tenants\public\data\invoicer"
    File /r /x *.bak "${LIANJA_INSTALLDIR}\data\invoicer\*.*"
    SectionEnd
    A:
    On the client machine where you have run your installer, have a look at the drive:\lianja\log\log.txt file. This will include the dataDirectory and other directory settings it is using. Check that this directory contains the databases that you are expecting.

    You can also use the --debug command line switch in your Lianja App Center shortcut, e.g. if installed on C:
    C:\lianja\bin\lianjaruntime.exe --debug
    This will then output debugging information to the debug.txt and/or debug_client.txt files in the C:\lianja\debug directory.
    A2:
    One of my tables was in a separate folder so when I built the installer it was not included. After moving the table to the correct database folder and rebuilding the database, everything worked.



    Q:
    I am having difficulty deploying my first app to a windows client. I have downloaded the windows installer, created an installer file, chose my app and database and it completes the compile without errors. Upon launch, the install program runs and completes, but when I go to the app center I cannot log on as an admin.
    A:
    To publish the app, open the app, go to Settings (lower left), and then check the Publish checkbox (upper right). Save, exit, deploy.

    Whether an app is published or not is contained in the .lianja file for the app.
    The App Center inspects the .lianja files in their App directories, and publishes the ones that are marked as published.
    There is no such thing as "administrative access," in other words. So, if you were to open up the .lianja files in your deployed app directory, you could find the <apppublished> element and change the value to 1.
    Then when you reopen the app center you will see the app icon.

    As for users tied to an App: it may be the case that if the app isn't published, they aren't allowed into the app center. You'll see. If there are still issues, it is likely due to your setup of the roles.



    that's what makes Lianja so special: write once, deploy anywhere.



    Q:
    I'm trying to deploy my app on my production server where I already installed the cloud server and shared the public tenancy folder.
    The deployement log show that all data where copied successfully but nothing was written on the server. The production server is running Win 2k8 server R2.
    Below are some last lines of the logfile
    ---
    Copying Selected Library files.
    Copying file 'C:\Lianja\library\report.rsp' to 'd:\Lianja\cloudserver\tenants\public\library\repo rt.rsp'
    Copying file 'C:\Lianja\library\report.rsp' to 'd:\Lianja\cloudserver\tenants\public\wwwroot\libr ary\report.rsp'
    Copying file 'C:\Lianja\library\login_forgot_password.rsp' to 'd:\Lianja\cloudserver\tenants\public\library\logi n_forgot_password.rsp'
    Copying file 'C:\Lianja\library\login_forgot_password.rsp' to 'd:\Lianja\cloudserver\tenants\public\wwwroot\libr ary\login_forgot_password.rsp'
    Copying file 'C:\Lianja\library\login_learn_more.rsp' to 'd:\Lianja\cloudserver\tenants\public\library\logi n_learn_more.rsp'
    Copying file 'C:\Lianja\library\login_learn_more.rsp' to 'd:\Lianja\cloudserver\tenants\public\wwwroot\libr ary\login_learn_more.rsp'
    Deployment completed successfully.
    ----
    A:
    If you mapped your server drive to drive D:, than it is copied OK.
    From log file, I suspect all is copied to (development) local drive D:
    Good structure but wrong drive, I think.
    You can check your local drive D: .

    You should map your server drive to X: or something and set it to copy to X:



    All topics in [Answers] alphabetically: http://www.lianja.com/community/show...p?2717-Answers
    This same topic is extended to another thread: http://www.lianja.com/community/show...s-Deployment-2 (dont ask why: I was young)
    Last edited by josipradnik; 2016-10-25 at 02:28.

  3. #3
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    Q:
    I only want to do a 'simple' desktop deploy. I have tried going to Apps and doing a quick deploy, but get this message:
    "
    Deploying using 'Copy'
    No Selected Database files to copy.
    No Selected App files to copy.
    No Selected Library files to copy.
    No Selected Page Library files to copy.
    No Selected Extension Library files to copy.
    No Selected MetaTypes to copy.
    No Selected Modules to copy.

    A:
    Follow the steps/screenshots here.
    In the Deploy Workspace:
    1. Click the checkbox next to the database, Apps and library files you want to deploy.
    2. Click the 'Preview changes' toolbutton in the headerbar.
    3. Click the 'Commit changes' toolbutton in the headerbar.
    If you are using 'Quick Deploy', click the 'Setup' button - this takes you to the Deploy workspace - click the checkbox next to the database, Apps and library files you want to deploy then return to the Pages workspace and reopen the 'Quick Deploy' dialog and you can now 'Preview' and 'Commit' from the dialog as required.



    Q:
    Is it possible to build an app in Lianja that can run outside the app center?

    A:
    For desktop clients, the Lianja App Center is required, but you can specify command line options to open an App or program directly and disable the App Center splash screen. See Command Line Switches in the Lianja wiki.



    Q:
    **** Warning **** Failed to copy table 'homeloan\contact' (possibly a linked table on a shared drive)
    I get the warning above. This table was already deleted from the database in APP builder. I tried rebuilding the database and deploy again, still the above warning persisted.

    A:
    Try restarting the App Builder, close your App (if open) then deploy directly from the Deploy workspace.



    Q:
    Is there an overview available for that Custom deploy option in Settings?
    What I'm wondering is what kinds of information are passed to the custom app (if any)?
    Related to that: is it called once, or multiple times?

    A:
    'Custom' Publisher allows you to specify the 'Path' for the publisher command and the 'Arguments' to pass to that command.
    In the App Settings, where this can also be defined (Deployment), it gives the following examples:
    Publisher: 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.

    A2:
    So looking at rsync parameters, it appears that the Custom app gets, in addition to whatever customer arguments one has, the local file path and the remote file path, which means one call per file.
    Furthermore, it appears that the Custom app gets "run" as a system executable, which makes things a bit more complicated. A Custom Script option would be handy. As contrasted with running LianjaRuntime.exe for every file.



    Q:
    In the meantime I am using a small hosted server from 1and1.
    What is the recommended way of deploying a cloudserver app to a hosted machine?
    I can deploy locally, then copy Data, App and wwwroot\app files via ftp or dropbox.

    A:
    If you have an SFTP server on your 1&1, that's an option for deployment in Settings. Filezilla server, however does not have SFTP, so you would need a Custom publisher to do FTPS. Doing this with chilkat is very easy, so it could be a Lianja prg that you use as the custom publisher. I don't know what Lianja expects, but since it works with rsync, I'm guessing the arguments passed will be in that order.
    Also: for your FTP server on 1&1 (which I use also), you will be getting hammered by bad guys trying to get in. I ended up limited the source IP in Windows Advanced Firewall to keep the server from being hammered.
    You would be calling the pathed Lianjaruntime.exe with the appropriate arguments.



    Q:
    Do I understand correctly that since there is no .exe capabilities that an app can't be packaged to self install? And that is more like, I can sell an app that can be run EITHER on desktop or online...and that the desktop is really a shortcut to an online app?
    Also, if I create an app with a database of items(proprietary per user),does the database reside on each individual's desktop or pc?
    My app is an estimating app that needs a database of items, each item having attributes such as material price, labor price, etc. But each client that I sell to needs his or her own database of items that they may add to or delete or edit...not affecting any other client's database.

    A:
    In short, yes - you can build and sell applications to various clients that are not online. The databases will be installed on the clients local network.
    You can think of Lianja in the same context of a pure python application. You create a .py file for python. It's not technically an executable, but the python execution behind it runs as an executable or service.
    Very similar to Lianja. There is an executable/service behind the scenes. So the deploy is not an executable, but the code underneath the hood is.

    A2:
    When creating a desktop app, Lianja has a built-in "install builder" (which you have to configure, although a default template is provided). This is what you use to install the "desktop only" app on a user's machine.
    The days of desktop-only apps is, however, over. What Lianja gives you is a way to create the same app in a desktop version (running Electron) and also running on web/mobile. These apps all hit against the Lianja Cloud Server.



    One of the things I've been looking at recently is the need to be able to handle Continuous Integration of databases when Apps are running live in the cloud.
    There was a need to be able to lock and unlock named resources (shared and exclusive) as requests come into the cloud server.
    To achieve this I have implemented several new functions in Lianja 3.4.
    Code:
    lockResource("name_of_resource", "mode")
    where mode can be "shared" or "exclusive".
    Code:
    unlockResource("name_of_resource")
     unlockResourceAll()
    The Cloud Server locks a resource called "LianjaCloudServerRequestLoop" for "shared" access (many concurrent readers) while a request is being processed.
    This provides everything we need to be able to provide Continuous Integration of our Apps and data without needing to bring the server down.
    As I progress with Lianja 4.0 and the Lianja Hosted Cloud the ability to compare database schemas and also package up apps and upgrade them in place on the server is now possible.
    For those of you "rolling your own", you can write a .rsp page to perform live updates. For example if your page was called upgrader.rsp inside it...
    Code:
    unlockResource("LianjaCloudServerRequestLoop")
    lockResource("LianjaCloudServerRequestLoop", "exclusive")
    // when the resource access is granted execution continues.
    //
    // perform your upgrade procedure possibly processing an upgrade script that you POSTed
    //
    unlockResource("LianjaCloudServerRequestLoop")
    It is worth mentioning that these functions are cluster-safe meaning that they can operate across multiple containers and/or VMs.



    You can declare your own resource names that are specific to your own requirements.
    The resourcelocks are not shared between development and runtime. They are specific to each. So if you are testing this from the app builder it won't have any effect.
    Resource names can be anything you want them to be. You use lockResource() in your own applications to gain shared/exclusive access to critical blocks of code or operations.
    Think of them as cluster-safe mutex/semaphores that are shared across all instances that access the same data.
    process A:
    Code:
    lockResource("HanksSpecialResource", "exclusive")
     // this will block until no more "shared" or "exclusive" locks on the resource "HanksSpecialResource"
     // do whatever you want now you have exclusive access to "HanksSpecialResource"
     unlockResource("HanksSpecialResource")
    and in another process B:
    Code:
    lockResource("HanksSpecialResource", "shared")
    .. if process A has exclusive access you will be blocked until it unlocks
    Code:
    unlockResource("HanksSpecialResource")


    Q:
    I intend to do development on a PC, and upon finish testing, deploy the APP(s) to the actual web server. Is there a quick way to do so if both machines had Lianja installed??

    A:
    Use the deploy workspace.
    If you setup a project and add all the apps and databases that you use to the project, when you select the "Deploy" workspace all files in the project will be selected for copying to the remote server.
    You can use sftp or a network drive.
    In Lianja 4.0 you will be able to create a lianja .lpk (Lianja package) and deploy that to the "deploy" folder in the cloud server. The cloud server can (optionally) unzip the .lpk file updating only the files that have changed. It will also detect database schema changes and alter the tables to match the new table structures. This can be done on a "live" system without any need for down time. This is all part of the Lianja CI (Continuous Integration) pipeline which is coming as part of Lianja Hosted Cloud).
    In the current shipping version you do not have this functionality so using sftp from the "Deploy" workspace is the best solution.




    All topics in [Answers] alphabetically: http://www.lianja.com/community/show...p?2717-Answers
    This same topic is extended to another thread: http://www.lianja.com/community/show...s-Deployment-2

    These answers are also systematized on the site "Lianja developer": https://lianjadeveloper.wordpress.co...ry/deployment/

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us