Skip to Content
Technical Articles
Author's profile photo Florian Pfeffer

UI5 Tooling Custom Task to deploy UI5 sources to an ABAP server

In the past Grunt was used as main task runner for the UI5 development process. In a build pipeline a deployment step is an important functionality to be able to deploy builded and tested sources automatically to test and even production system. In the UI5 area for that the grunt-nwabap-ui5uploader Grunt task could be used.

But as time and technology always involves, the new UI5 Tooling is going to replace Grunt as build tool for UI5 applications. To support the deployment process of UI5 sources to an ABAP server directly with the UI5 Tooling (without mixing different tools), the UI5 Tooling custom task ui5-task-nwabap-deployer is provided.

Details about the options and how to use it can be found in the Github repository: https://github.com/pfefferf/ui5-nwabap-deployer/tree/master/packages/ui5-task-nwabap-deployer

Assigned Tags

      22 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Christian Tapia
      Christian Tapia

      Hello,

      Great. Is there something simlar for deployment in SCP Neo / CF?

      Best regards.

      Author's profile photo Florian Pfeffer
      Florian Pfeffer
      Blog Post Author

      There are no specific UI5 tooling tasks available yet. But it can be simply done using the SAP Cloud Platform Console Client for Neo or the Cloud Foundry CLI for CF.

      Author's profile photo Frank Stødle
      Frank Stødle

      Florian, thanks you for your work on this. I've followed the steps, but I get the error

       

      "Error: taskRepository: Unknown Task ui5-task-nwabap-deployer"

       

      when running "ui5 build"

       

      Any ideas what could be missing?

      Author's profile photo Florian Pfeffer
      Florian Pfeffer
      Blog Post Author

      Did you define the dependency (ui5 -> dependencies) for the task in your package.json?

      Author's profile photo Frank Stødle
      Frank Stødle

      Yep, like this:

       

      {
        "name": "cts-worklist",
        "version": "1.0.4",
        "description": "CTS Worklist",
        "devDependencies": {
          "@sap/ui5-builder-webide-extension": "1.0.5",
          "@ui5/cli": "1.7.0",
          "nwabap-ui5uploader": "^0.3.4",
          "ui5-task-nwabap-deployer": "*"
        },
        "scripts": {
          "build": "ui5 build --include-task=generateManifestBundle generateCachebusterInfo"
        },
        "ui5": {
          "dependencies": [
            "@sap/ui5-builder-webide-extension",
            "ui5-task-nwabap-deployer"
          ]
        },
        "repository": {
          "type": "git",
          "url": "git+https://github.com/Equinor/CTSWorklist.git"
        },
        "author": "Frank Stødle",
        "license": "ISC",
        "bugs": {
          "url": "https://github.com/Equinor/CTSWorklist/issues"
        },
        "homepage": "https://github.com/Equinor/CTSWorklist#readme",
        "dependencies": {
          "express": "^4.16.4",
          "morgan": "^1.9.1",
          "request": "^2.88.0"
        }
      }
      Author's profile photo Florian Pfeffer
      Florian Pfeffer
      Blog Post Author

      Ok, thanks. Found the error. In the published NPM package the ui5.yaml file describing the task was missing. I fixed that. Version 1.0.1 is published.

      Author's profile photo Frank Stødle
      Frank Stødle

      Great! I'll try it out

      Author's profile photo Frank Stødle
      Frank Stødle

      Seems to work now - getting some other errors, will try to sort that out myself. Thanks!

      Author's profile photo Frank Stødle
      Frank Stødle

      I am getting "Connection error has occurred" from the deploy task.

      When I run the "nwabap upload" from the command line with the same parameters it works as expected.

      Any ideas?

      Author's profile photo Frank Stødle
      Frank Stødle

      Florian, could support for HTTPS have been be broken in this version?

      Author's profile photo Pedro Bessa
      Pedro Bessa

      Hi Florian,

      It looks like the dist folder is created after the task. The first time i run

      ui5 serve

      The application is deployed without any files. The second time ( since the folder dist is already there ) the files are uploaded.

      Since i'm using the script:

      rimraf dist && ui5 build  --dest dist/webapp

      no files are uploaded.

      Any ideas?

       

      Best regards,

      Author's profile photo Florian Pfeffer
      Florian Pfeffer
      Blog Post Author

      Checked the behavior and found an issue. Version 1.0.2 fixes that issue.

      Author's profile photo Pedro Bessa
      Pedro Bessa

      Thanks Florian,

      It's working fine 🙂

      Much appreciated

      Author's profile photo Nelis Lamprecht
      Nelis Lamprecht

      Hello Florian,

      Am I right in saying you cannot authenticate with ui5-task-nwabap-deployer when a user name has a numeric value ?

      I have been struggling to authenticate because all our user id’s are numeric and start with a leading ‘0’. I thought initially that the leading ‘0’ was the cause but it appears no numeric user works ?

      Thanks and best regards,

      Nelis

      Author's profile photo Florian Pfeffer
      Florian Pfeffer
      Blog Post Author

      Hi Nelis Lamprecht ,

      no, it should work. I tried it with a user 0999888 for instance and it worked in both ways (by setting the info in the ui5.yaml configuration or via environment variables).

      How does your configuration looks like and what error do you get?

      BR

      Author's profile photo Nelis Lamprecht
      Nelis Lamprecht

      Thanks Florian and apologies.

      I initially created a test non-numeric account and was able to login but of course I got a developer license error so my ui5.yaml configuration is not the issue. I disabled all login methods besides basic auth on /sap/bc/adt yet I still can't login for some reason with my staff number and get "Error: Error: auth() received invalid user or password". My struggle at the moment is that I can't seem to find any trace of the error to help troubleshooting but I have other priorities and will continue trying to solve this later.

      Regards

      Author's profile photo Wolfgang Röckelein
      Wolfgang Röckelein

      Hi Florian Pfeffer ,

      thanks for the very helpful task!

      I assume resources/pattern also accepts an array of pattern in order to exclude files not wanted, eg. ['**/*.*',!'localservice/**/*.*',!'test/**/*.*'] .

      Regards,

      Wolfgang

      Author's profile photo Florian Pfeffer
      Florian Pfeffer
      Blog Post Author

      Hi Wolfgang Röckelein,

      as the @ui5/fs.DuplexCollection byGlob method supports a glob pattern array, it is supported.

      Regards,
      Florian

      Author's profile photo Wolfgang Röckelein
      Wolfgang Röckelein

      Hi all,

      just for info, if you want this to work, use it eg like this

      "['**/*.*','!**/localservice/**/*.*','!**/test/**/*.*','!**/test.html']"

      Regards,

      Wolfgang

      Author's profile photo Loucas Stylianou
      Loucas Stylianou

      Hi Florian,

       

      Thanks a lot for this custom task. Is it possible to use saprouter string ?

      Kind regards,

      Loucas Stylianou

      Author's profile photo Florian Pfeffer
      Florian Pfeffer
      Blog Post Author

      Hi Loucas,

      no this is not supported.

      Regards, Florian

      Author's profile photo Wolfgang Röckelein
      Wolfgang Röckelein

      Hi all,

      has anybody tried already this against an ABAP Environment/Steampunk system? Anyone willing to share the experience?

       

      Regards,

      Wolfgang