Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
midhun_vp
Active Contributor

Have you read Martin's recent blog on the new features of HANA Cloud Platform mobile services? In that list Staging is one of the notable feature. Staging helps the developers to give their application to the users for testing, after the completion of the tests it could be moved immediately to the end users from admin cockpit itself.

In this blog I am explaining how to put your application in a test state and then move it to the production.

Configure Application in Cockpit

  • Open HCPms admin cockpit, then click on Applications.
  • Click on Configure and provide below details.

   

 

    Note: Backend URL - http://services.odata.org/V2/OData/OData.svc

  • Click on Save.

Create a Kapsel Application

The following steps will create a simple Kapsel app with an AppUpdate plugin.

  • Cordova command to create project
      cordova -d create C:\Kapsel_Projects\StagingDemo com.sap.staging StagingDemo "{\"plugin_search_path\":\"C:/SAP/MobileSDK3/KapselSDK/plugins/\"}"
      cd C:\Kapsel_Projects\StagingDemo
      cordova -d platform add android
              
      cordova -d create ~/Documents/Kapsel_Projects/StagingDemo com.sap.staging StagingDemo "{\"plugin_search_path\":\"/Users/i12345/SAP/MobileSDK3/KapselSDK/plugins/\"}"
      cd ~/Documents/Kapsel_Projects/StagingDemo
      cordova -d platform add ios

   

  • Replace index.html (C:\Kapsel_Projects\StageDemo\www\index.html) with this sample code. This is an extended code from these kapsel guides.
  • Add AppUpdate plugin and logon plugin
      cordova -d plugin add com.sap.mp.cordova.plugins.appupdate
      cordova -d plugin add com.sap.mp.cordova.plugins.logon
  • Run the following command to build project.
      cordova build
  • Run app in emulator using the below command.
      cordova emulate android

      cordova emulate ios
  • Login to the application. The credentials doesn't matter since we configured the app with No Authentication. The application will show a list of products.

   

  • From HCPms Admin Home page click on Registrations and Users > Turn on "Is Tester" button. Hence this user gets the applications which are under stage state.

   

Enable Staging

In this step we are going to upload a new version of the Kapsel application to HCPms for testing (Stage state).

  • When we run the app for the second time to identify the a change, update index.html file as given below. This will get the list of Suppliers instead of Products.

  • Build the app
      cordova build

  • The Kapsel command line provides a way to create a zip file that could to uploaded to HCPms. Open a command prompt and change path to
      C:\SAP\MobileSDK3\KapselSDK\cli

      ~/SAP/MobileSDK3/KapselSDK/cli

  • Run command
      npm install -g

        For Mac:

      sudo npm -g install

  • Open command prompt and change the path to your Kapsel project (C:\Kapsel_Projects\StagingDemo) and execute the command
      kapsel package

   

    Now you could find a zipped file created inside your project folder.

   

  • Next step is to upload the zipped file to HCPms. To upload the file open HCPms home page then click on Applications > Choose your application > Configure > App specific settings. Then click on Upload Kapsel and browse the zipped file.

   

  • Choose the application uploaded, then click on Stage. It moves the application to stage state. Which will be accessible to the users who are testers.

   

Test App on Emulator or Device

Now, when we close and reopen the app the AppUpdate plugin identifies that there is an updated app in the server. It gives a pop up for relaunching the app to download the changed files from server.

  • Choose Relaunch Now. You could see that the list is changed from Products to Suppliers.

   

After testing the application, from admin cockpit choose the application under Stage state, then click on Deploy, which will make the application available for users in production.

Regards,Midhun

SAP Technology RIG

Labels in this area