Export Version and Adapters from the Source Code using the mfpdev (Exporting Zips from Adapter and Source Code) - ibm-mobilefirst

Hi we are planning to have a automated build for our IBM Mobilefirst cordova project. we are now using the mfpdev to deploy the adapter and also to register the new version using the CLI via Azure dev ops. But some of our MFP Server's are not accessible to the outside so for us the only way is to go the mfpconsole export the Adapter and Version and manually install them in those machines. Is there any command to export the Adapter.zip and version.zip from our source code via mfpdev so that i can store them in our build process and we wont loose older adapters in the process.
The only thing i can see it mfpdev app export which help me export the entire application which i don't need.

Mfpdev CLI does not have such an option. However, you can either use mfpadm command line tool or Admin REST endpoint to achieve this:
mfpadm command:
Adapter get binary
Usage:
mfpadm adapter mfp <Adapter_Name> get binary > /tmp/MyAdapter.adapter
Export resources using Admin REST API:
Download Resources. With this option, you can export adapter binaries.
Usage:
https://www.example.com/mfpadmin/management-apis/2.0/runtimes/myruntime/export?resourceInfos=<Adapter_Name>||ADAPTER_CONTENT

Related

IBM MFP How can I use mfpdev-cli upload (deploy) the .adapter?

How can I use mfpdev-cli upload (deploy) the .adapter?
I need upload the .zip and .adapter in my MFP project
when I call (in root folder)
mfpdev app webupdate --build
and I will get projecet.zip in MobileFirst folder
then, I call (not in root folder)
mfpdev app webupdate --file project.zip
it's success update.
then It the same in adapter
I call (in root folder)
mfpdev adapter build
and get projectAdapte.adapter in target folder
then, how can I upload this projectAdapte.adapter (not in root folder and not use mfpdev adapter deploy )?
If you want deploy an Adapter to the server first build the adapter with command
mfpdev adapter build
-which will generate .adapter file in target folder
To deploy there are two ways
From MFP server console click on Actions->Deploy Adapter-->Brows .adapter file in target folder -->Click on deploy
mfpdev adapter deploy (For this you need to add mfpdev server using mfpdev server add command )
If there are more than adapter to be build and deploy then add all in front of command for ex:
mfpdev adapter deploy all
mfpdev adapter build all
mfpdev app webupdate is used for direct update feature.
For more details about mfpdev cli commands see here: MobileFirst CLI to Manage MobileFirst Artifacts.
And for more details about Adapters see here: Developing Adapters
An Adapter is a separate Maven project. If you are creating multiple adapter in a project then you can put all adapter in a one file.
how can I upload this projectAdapte.adapter (not in root folder)?
You can build & deploy all adapter from project root folder using these command:
mfpdev adapter build all
mfpdev adapter deploy all

How can I deploy OSGi application?

I have created OSGi service and Consumer application from this link.
However application is perfectly working from eclipse run configuration as described in link. Now I want to run this application from windows command line.
I created a xx.jar file using Export option in eclipse but when I try to run this jar, it says 'no main manifest attribute, in xx.jar'.
Any ideas?

What files will get deployed and where can I find the files in worklight console?

We are developing a mobile app using IBM MobileFirst platform.
We compile the code using the command line tool with the command 'mfp build' and deploy it using 'mfp deploy', and we are able to preview the application from the URL mentioned below: http://localhost:xxxxx/worklightconsole/index.html
After doing 'mfp build' I get these 6 files:
mobapp.war
mobAppAdapter.adapter
Dashboard-all.wlapp
Dashboard-common.wlapp
Dashboard-desktopbrowser-1.0.wlapp
Dashboard-ipad-1.2.wlapp
Questions:
Where can I find the 6 files in 'worklight console'? (or)
Which other URL I have to refer to verify whether the files have been deployed correctly or not?
Because when I type in 'mfp build' it deploys the files but we are not sure where its getting deployed. We don't have WAS installed instead 'liberty' is used to our knowledge
The MobileFirst Platform CLI tool contains an embedded WebSphere Liberty profile server inside of it. It is this server and its internal database (during development time(!)), that the artifacts you have mentioned get deployed to.
You create a project ("mfp create").
You then start the server ("mfp start").
You then create your applications, develop them, etc...
Eventually you build and deploy it to the server ("mfp build", "mfp deploy").
The resulting files of the build command are the .adapter and .wlapp files.
These get deployed using the deploy command to the server's database.
You then see these files in the console using "mfp console".
The .war file is your project's runtime, containing metadata required for various server operations. This file is part of the server and handled automatically by the underlying tooling. This is invisible to you during development.

Can IBM Worklight Mobile build faster

Currently I am using Eclipse. Can I use another IDE or a customized configuration for Eclipse to build for my project faster? I want to increase my production time.
Worklight 6.2 and above provide a command line interface which you can use instead of Eclipse.
With some development effort you could also take the CLI and hook it to other IDEs that provide pluggability options.
You can read more about the CLI, here:
For Worklight 6.2: Command Line Interface for IBM Worklight Developers
For MobilFirst 6.3 and above: Using CLI to create, build, and manage MobileFirst project artifacts

Adding worklight adapter programmatically

I am creating application which should be plugin upgradable.
Problem is that every plugin should consist of some client code and there should also be some sort of adapter which will fetch data to application from 3rd party site/api/... So my problem is how do I add new adapter to server programmatically when someone deploy new plugin?? Is it possible? Or is there better architectonic approach?
Using Worklight Studio (plug-in for Eclipse), you cannot programmatically add adapters.
If you are using Worklight 6.2, you can explore the newly released Worklight CLI, which is a command line interface to create projects, applications, adapters, environments, etc... perhaps you could devise a way to intergrate this into a build a system of your own that will fit your needs.
Training module: Using CLI to create, build, and manage Worklight project artifacts
User documentation: Command Line Interface for IBM Worklight Developers