We can generate the ".war" file for the Application developed using the ASE template and upload the war file. This article will walk you through the steps of deploying an ASE war file for both Fusion 4.x as well as Fusion 5.x cluster.
This can be done in two ways:
- Uploading the war file from the Fusion 4.x UI (this will not be available for Fusion 5.x)
- Upload the WAR to the webapps service using rest API (this command will be used for uploading WAR file in fusion 5.x as starting in Fusion 5.0, AppStudio is no longer included as part the Fusion UI).
Steps to generate the WAR file:
- Execute the command ./app-studio package to generate the war file.
2. The above command once successfully gets executed will create the war file in the location:
/<$Application>/dist/app-studio-enterprise.war
Step to Upload/deploy the war file:
- Uploading the WAR file from the Fusion 4.x UI:
Here you can upload the War file from the Fusion Admin UI. Here is the screen snippet to upload the WAR file:
Select the Upload button and then upload the WAR file.
Once the WAR file is published you can click on the view Published UI to navigate to the AppStudio application UI:
2. Upload the WAR to the webapps service using Rest API: we will be demonstrating this step in two parts:
- Uploading the war file using Rest API in Fusion 4.x cluster
- Uploading the war file using Rest API in Fusion 5.x cluster
a. Uploading the war file using Rest API in Fusion 4.x cluster
Below is the curl command that can be used to upload the war file and then once it’s completed you can navigate to the published UI to check the new AppStudio application.
curl -v -u user:password -H 'Content-type: application/zip' -X PUT 'http:<fusion-host>:8764/api/apollo/apps/<AppName>/webapps/<application-name>/war' --data-binary @app-studio-enterprise.war
Here is the screenshot while executing the API command:
Once the WAR file is upload successfully you can navigate to the Fusion UI to check the latest published date/time and go to the published UI to check the new AppStudio application.
b. Uploading the war file using Rest API in fusion 5.x cluster
- Create a new App Studio project in Fusion 5.x using the below command:
curl -v -u <user>:<password> -H 'Content-type: application/json' -X POST https://<FusionHost>/api/apps/<AppName>/webapps -d '{"id":"my-movies-app","name":"My Movies App"}'
2. Upload the WAR to the webapps service
curl -v -u <user>:<password> -X PUT -H 'Content-type: application/zip' https://<FusionHost>/api/apps/<AppName>/webapps/my-movies-app/war --data-binary @app-studio-enterprise.war
Screenshot of uploading a war file is:
Now please note if your app is using AppKit 4.11.0, you should be able to access your app at host:port/webapps/webapp_name. If you are using an AppKit version lower than 4.11.0, then you will need to expose a LoadBalancer in your cluster and access it via this port.
Code:
kubectl expose deployment my_namespace-webapps --port=80 --target-port=8780 \
--name=webapps-ext --type=LoadBalancer
Here is an example of the UI once you upload your WAR file and load the page in the browser:
References:
https://doc.lucidworks.com/how-to/deploy-ase-in-5.x.html
https://doc.lucidworks.com/how-to/dev-and-deploy-app-studio.html
Comments
0 comments
Please sign in to leave a comment.