Code Monkey home page Code Monkey logo

cloud-mta-build-tool's Introduction

MBT logo


CircleCI Go Report Card CII Best Practices Coverage Status Beta GitHub stars dependentbot REUSE status

Description

Multi-Target Application

Before using this package, make sure that you are familiar with the multi-target application concept and terminology. For background and detailed information, see the Multi-Target Application Model guide.

The Cloud MTA Build Tool Overview

The Cloud MTA Build Tool is a standalone command-line tool that builds a deployment-ready multitarget application (MTA) archive .mtar file from the artifacts of an MTA project according to the project’s MTA development descriptor (mta.yaml file) or from module build artifacts according to the MTA deployment descriptor (mtad.yaml file). Also, it provides commands for running intermediate build process steps; for example, the mta.yaml file validations, building a single module according to the configurations in the development descriptor, generating the deployment descriptor, and so on.

For more information, see the Cloud MTA Build Tool user guide

Demo

This demo shows the basic usage of the tool. For more advanced scenarios, follow the documentation.

Install

For convenience the mbt executable is available via npmjs.com so consumers using a nodejs runtime can simply run:

It is also possible to download and "install" the mbt executable via github releases.

The Cloud MTA Build Tool Images

The Cloud MTA Build Tool published docker images on docker hub with a pre-configured set of runtime tools (nodejs/java/maven/...).

Node.js v10 and lower minor version of Node.js v11, v12, v13 /ECMAScript modules

More and more npm packages use ECMAScript modules instead of commonJS, for ECMAScript modules are the official standard format to package JavaScript code for reuse. From v1.2.25, we use axios instead of binwrap(which has moderate severity vulnerabilities) to download binary files, but axios only supports ECMAScript modules and can't work on Node.js v10 and lower minor version of Node.js v11, v12, v13. The axios can work on latest version of Node.js v11.15, v12.22, v13.14. So since v1.2.25, mbt will not support Node.js v10 and lower versions, including lower minor version of Node.js v11, v12, v13.

License

Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file. Please note that Docker images can contain other software which may be licensed under different licenses. This License file is also included in the Docker image. For any usage of built Docker images please make sure to check the licenses of the artifacts contained in the images.

Contributions

Contributions are greatly appreciated. If you want to contribute, follow the guidelines.

Support

Please follow our issue template on how to report an issue.

cloud-mta-build-tool's People

Contributors

allavolkov avatar ashwinsyadgiri avatar avizov avatar bd82 avatar ccfenner avatar cloudmtabot avatar dependabot-preview[bot] avatar dependabot[bot] avatar enchobelezirev avatar fwilhe avatar jhornik avatar jiangyutao avatar jonathanbaker7 avatar katunin-ng avatar martwz avatar michawai avatar paolaufer avatar pertzsch avatar rayakoren avatar rimasirich avatar rlindner81 avatar sapirpol avatar sebastianwolf-sap avatar shimit avatar tal-sapan avatar tyzanol avatar wangshen-sap avatar yotamshapira avatar young-yang03 avatar yutaoj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloud-mta-build-tool's Issues

Console output truncated upon termination

  • MBT Version: 1.0.0
  • OS Version: Ubuntu 18.04.3 LTS on Windows Subsystem for Linux

This is a general comment - in this environment, MBT seems to truncate console output upon exiting during build. The console output (potentially from the launced processes) is obviously truncated at some point, and MBT finishes the output with "Error: could not build the MTA Project...".
If would be great if the console output could be flushed or awaited before terminating the process, because the most important messages about the reason of e.g. build failure get lost, since they are usually trailing the console output.

Adjust Dockerfile Node Version to be Compatible with Hana Client

This issue applies to the following:

  • Docker Image Version: 1.0.0 (available on dockerhub here: devxci/mbtci)

This docker image uses Node version v12.13.0 which is incompatible with commonly used hana-client packages. This issue is documented in #368

ARG NODE_VERSION=v12.13.0

I was able to confirm this error by trying to run npm install for a project that uses a hana dependency (in my case @sap/[email protected] which has a dependency on @sap/[email protected]) for both the standard docker images of node:10.13.10 and node:12.13.10 (while also making sure to install other dependencies like node-gyp). What I found was that the install suceeded in the 10.13.10 version and failed in the 12.13.10 version, which is identical to the findings in issue #368.

Given that projects built with this tool will often require interaction with hana, I feel like a compatible version of node should be used in the image.

Provide Tap to install MTA Build Tool with Homebrew

To provide an easier way to install the cloud MTA build tool on MacOS or Linux machines it would be nice to have an own Homebrew Tap containing a formula for Homebrew (Package Manager for MacOS & Linux).

SAP has already provided such a Tap for SapMachine.

To help myself I created a Tap containing the mbt here: https://github.com/CCFenner/homebrew-cloud-mta-build-tool

Using this one could install the latest version using brew install ccfenner/cloud-mta-build-tool/mbt in a standard way & ready to use.

What do you think?

Failed mtar file deploy to Cloud Foundry

I'm trying to deploy mtar file to Cloud Foundry but I got similar errors:

Cannot retrieve service parameters of service "productdb_html5_repo_host"
Cannot retrieve service parameters of service "productdb-db-hdi-container"
Cannot retrieve service parameters of service "productdb_html5_repo_runtime"

for example:
#2.0#2019 11 27 12:54:23.414#Z#WARN#com.sap.cloud.lm.sl.xs2.f84a2c16-1114-11ea-9fce-eeee0a801b06.MAIN_LOG.DetermineServiceCreateUpdateActionsTask#
######com.sap.cloud.lm.sl.cf.persistence.services.ProcessLogger########flowable-async-job-executor-thread-28###
[DetermineServiceCreateUpdateServiceActionsStep] Cannot retrieve service parameters of service "productdb_html5_repo_runtime"#

org.cloudfoundry.client.lib.CloudOperationException: 400 Bad Request: This service does not support fetching service instance parameters.

Please provide the following info:

  • MBT Version: How can I get this?
  • OS Version: Win 10 X64

mta.yaml:

ID: productdb
_schema-version: '2.1'
parameters:
  deploy_mode: html5-repo
version: 0.0.1
modules:
  - name: productdb_appRouter
    type: approuter.nodejs
    path: productdb_appRouter
    parameters:
      disk-quota: 256M
      memory: 256M
    requires:
      - name: productdb_html5_repo_runtime
      - name: productdb-uaa
      - name: srv_api
        group: destinations
        properties:
          forwardAuthToken: true
          name: srv_api
          url: '~{url}'
  - name: productdb_ui_deployer
    type: com.sap.html5.application-content
    path: productdb_ui_deployer
    requires:
      - name: productdb_html5_repo_host
    build-parameters:
      requires:
        - name: ui-product
          artifacts:
            - './*'
          target-path: resources/ui-product
  - name: productdb-db
    type: hdb
    path: db
    parameters:
      memory: 256M
      disk-quota: 256M
    requires:
      - name: productdb-db-hdi-container
  - name: productdb-srv
    type: java
    path: srv
    parameters:
      memory: 1024M
    provides:
      - name: srv_api
        properties:
          url: '${default-url}'
    requires:
      - name: productdb-db-hdi-container
        properties:
          JBP_CONFIG_RESOURCE_CONFIGURATION: '[tomcat/webapps/ROOT/META-INF/context.xml: {"service_name_for_DefaultDB" : "~{hdi-container-name}"}]'
      - name: productdb-uaa
  - name: ui-product
    type: html5
    path: ui-product
    build-parameters:
      builder: grunt
      supported-platforms: []
      build-result: dist
    requires:
      - name: srv_api
        group: destinations
        properties:
          forwardAuthToken: true
          strictSSL: false
          name: srv_api
          url: '~{url}'
  
resources:
  - name: productdb_html5_repo_runtime
    parameters:
      service-plan: app-runtime
      service: html5-apps-repo
    type: org.cloudfoundry.managed-service
  - name: productdb_html5_repo_host
    parameters:
      service-plan: app-host
      service: html5-apps-repo
    type: org.cloudfoundry.managed-service
  - name: productdb-db-hdi-container
    type: com.sap.xs.hdi-container
    properties:
      hdi-container-name: '${service-name}'
  - name: productdb-uaa
    type: org.cloudfoundry.managed-service
    parameters:
      service-plan: application
      service: xsuaa
      config:
        xsappname: 'productdb-${space}'
        tenant-mode: dedicated

"property is not provided" error is returned in mbt build for property defined in the extension file

Hello,
Please provide the following info:

Steps to Reproduce:

  1. installing mbt
  2. cloning Project repo https://github.wdf.sap.corp/IPD/ipd.cf.central
  3. executing : mbt build -p=cf -e=mtad-aws-canary-ipd-dev-provider-ipd.mtaext

There is still a complaint about the missing url settings, which are part of the extension files. I am wondering, since it looks that the extension file has not been taken into account.

Would you kindly provide advice how to perform the mbt build/which settings needs to be done by the DEV team?

Output from my shell (also xmake and Pipeline had issues, so first wanted to get it work locally):

:ipd.cf.central $ mbt build -p=cf -e=mtad-aws-canary-ipd-dev-provider-ipd.mtaext [2019-12-03 12:50:38] INFO Cloud MTA Build Tool version 1.0.4 [2019-12-03 12:50:38] INFO generating the "Makefile_20191203125038.mta" file... [2019-12-03 12:50:38] INFO done [2019-12-03 12:50:38] INFO executing the "make -f Makefile_20191203125038.mta p=cf mtar= strict=true mode=" command... [2019-12-03 12:50:38] INFO validating the MTA project [2019-12-03 12:50:38] ERROR the "mta.yaml" file is not valid: line 56: the "url" property of the "ipd-app-router" module is unresolved; the "ipd-xray/url" property is not provided line 61: the "url" property of the "ipd-app-router" module is unresolved; the "ipd-xray-data/url" property is not provided make: *** [pre_validate] Error 1 Error: could not build the MTA project: could not execute the "make -f Makefile_20191203125038.mta p=cf mtar= strict=true mode=" command: exit status 2

BR
Stefan

Can't specify custom mtar name during 'mbt assemble'

Currently the option to specify a custom output mtar name does not work for the mbt assemble command. No matter what custom mtar name (with or with .mtar extension) I provide the assembled mtar is always named as <mta_id>_<mta_version>.mtar. I want the name to be custom because the artifact name that I want to upload on the nexus differs from the MTA ID/Version combination that is the default.

Please provide the following info:

  • MBT Version: 0.2.0
  • OS Version: Windows \ Mac
  • If possible, provide a link to the project.

Steps to Reproduce:

  1. Have an MTA project ready for assemble with any mtad.yaml
  2. Run mbt assemble -m custom.mtar or mbt assemble --mtar custom.mtar
  3. mbt still assembles the MTAR with the default name using <mta_id>_<mta_version>.mtar instead of using the name supplied by the command line argument.

Logs:

$ ./mbt.exe assemble -m custom.mtar
[2019-03-20 14:12:48]  INFO assembling the MTA project...
[2019-03-20 14:12:48]  INFO copying the MTA content...
[2019-03-20 14:13:15]  INFO generating the metadata...
[2019-03-20 14:13:15]  INFO generating the MTA archive...
[2019-03-20 14:14:56]  INFO the MTA archive generated at: C:\work\CF\Example-Project\mta_archives\com.sap.cloud.example_1.6.0.mtar
[2019-03-20 14:14:56]  INFO cleaning temporary files...
$ ls mta_archives/
com.sap.cloud.example_1.6.0.mtar

Passing version number from build servers

I'm currently looking into using this tool and integrate it in a Azure DevOps Pipeline, one of our requirements is that the version number is set during the build. I guess I can update the mta.yaml but it would be much easier if the version number can be passed as a parameter to mbt build.

Are there alternative methods available?

UAA instance not configured properly if multiple UAA instances refer to the same xs-security.json

Bug-Report

  • MBT Version: 1.0.8
  • OS Version: Windows 10 x64, Building with WSL on Ubuntu 18.04.3 LTS
  • Internal project. I can provide you a link per mail if needed.

Hello colleagues,

we have a project in which two uaa instances are created. Both instances use the same xs-security.json file. With the legacy mta archive builder, the configuration from the xs-security.json were merged into the mtad.yaml respectively. With cloud mbt the xs-security.json is now put into the archive file and is referenced in the MANIFEST.ML:

Name: xs-security.json
MTA-Resource: broker-uaa
Content-Type: application/json


Name: xs-security.json
MTA-Resource: ui-uaa
Content-Type: application/json

However, during a cloud foundry mta deployment one of the uaa instances will not be configured. Based in the order of the resource definition in the mta.yaml. The last one will be configured properly.

mta.yaml (snippet):

...
resources:
 - name: broker-uaa
   type: com.sap.xs.uaa
   parameters:
     service-plan: broker
     path: ./xs-security-broker.json
 - name: ui-uaa
   type: com.sap.xs.uaa
   parameters:
     service-plan: application
     path: ./xs-security.json
     config:
       tenant-mode: shared
...

Current workaround is to use a duplicate xs-security.json with a different name. But that is redundant and error prone.

npm installation of mbt issue

Please provide the following info:

  • MBT Version: v1.0.1
  • OS Version: "Ubuntu 18.04.2 LTS"

Steps to Reproduce:

1.npm install -g mbt
2.Got (https://github.com/SAP/cloud-mta-build-tool/files/3900865/log_file.zip)
an error, permission denied to use command mkdir

ERR { Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/mbt/unpacked_bin'
at Object.fs.mkdirSync (fs.js:885:18)
at /usr/lib/node_modules/mbt/node_modules/binwrap/binstall.js:46:10
at new Promise ()
at untgz (/usr/lib/node_modules/mbt/node_modules/binwrap/binstall.js:21:10)
at binstall (/usr/lib/node_modules/mbt/node_modules/binwrap/binstall.js:11:12)
at install (/usr/lib/node_modules/mbt/node_modules/binwrap/install.js:20:10)
at Object.install (/usr/lib/node_modules/mbt/node_modules/binwrap/index.js:14:14)
at Object. (/usr/lib/node_modules/mbt/node_modules/binwrap/bin/binwrap-install:18:9)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/usr/lib/node_modules/mbt/unpacked_bin' }

  1. Workaround (this command works): sudo npm install -g mbt --unsafe-perm=true --allow-root

Solution found in : npm/npm#17268

Seems that the npm install step described in https://sap.github.io/cloud-mta-build-tool/download/
does not work for my system. Perhaps a bug or just need a correction to the MBT guide. Thanks for your help in advance. I have attached a more comprehensive log file of the exception.

log_file.zip

Deployment failing with Unhandled exception in Java Buildpack after migrating to new MBT Tool

Please provide the following info:

  • MBT Version: Cloud MTA Build Tool version 1.0.6
  • GNU Make 4.2.1 Built for Windows32
  • If possible, provide a link to the project.

Java Module Definition:

  • name: srv
    type: java
    path: srv
    deployed-after: [ db ]
    build-parameters:
    timeout: 59m30s
    requires:
    - name: db
    builder: custom
    commands:
    - mvn clean install -P buildCDS
    parameters:
    memory: 4G
    disk-quota: 4G
    health-check-timeout: 600
    buildpack: sap_java_buildpack
    T_MODE: multitenant
    instances: 5
    properties:
    SAP_JWT_TRUST_ACL: [{"clientid":"","identityzone":""}]
    SPRING_PROFILES_ACTIVE: cloud
    LANDSCAPE: ${landscape}
    requires:
    - name: exciseTax-repository-independent-tenant-storage
    - name: Excise_Tax-audit
    - name: Excise_Tax-rabbitMQ
    - name: Excise_Tax-dynatrace
    - name: Excise_Tax-uaa
    - name: Excise_Tax-logging
    - name: Excise_Tax-unitOfMeasure
    - name: Excise_Tax-connectivity
    - name: Excise_Tax-destination
    - name: Excise_Tax-jobScheduler
    parameters:
    config:
    xsuaa_instance_name: Excise_Tax-uaa
    - name: Excise_Tax-managed-hdi
    properties:
    JBP_CONFIG_RESOURCE_CONFIGURATION: '["tomcat/webapps/ROOT/META-INF/context.xml": {"service_name_for_DefaultDB" : "~{managed-hdi-container-name}"}, "tomcat/conf/server.xml": {"connector.maxHttpHeaderSize":32000} ]'
    xsuaa_connectivity_instance_name: Excise_Tax-uaa

Deployment Logs:

2020-01-08T13:42:17.44+0530 [STG/0] OUT Cell ce1f6b1b-00ba-4c2b-b7df-57791a56c0b5 creating container for instance 8b805d51-4cb8-49ed-9e69-eabca4298cc6 2020-01-08T13:42:18.24+0530 [STG/0] OUT Cell ce1f6b1b-00ba-4c2b-b7df-57791a56c0b5 successfully created container for instance 8b805d51-4cb8-49ed-9e69-eabca4298cc6 2020-01-08T13:42:18.72+0530 [STG/0] OUT Downloading app package... 2020-01-08T13:42:19.22+0530 [STG/0] OUT Downloaded app package (4.2M) 2020-01-08T13:42:19.50+0530 [STG/0] OUT Compiling Java application... 2020-01-08T13:42:21.25+0530 [STG/0] OUT Java XS Buildpack Version: 1.20.1 2020-01-08T13:42:21.29+0530 [STG/0] ERR WARNING: User config value for 'tomcat/webapps/ROOT/META-INF/context.xml' is not valid, existing property not present.SEVERE: Unhandled exception in Buildpack main method: None of the available runtimes: [Tomee, Tomee7, Tomcat, Java Main] support the application in the specified path. Failed to compile droplet: Failed to compile droplet: exit status 9 2020-01-08T13:42:21.31+0530 [STG/0] OUT Exit status 223 2020-01-08T13:42:21.71+0530 [STG/0] OUT Cell ce1f6b1b-00ba-4c2b-b7df-57791a56c0b5 stopping instance 8b805d51-4cb8-49ed-9e69-eabca4298cc6 2020-01-08T13:42:21.71+0530 [STG/0] OUT Cell ce1f6b1b-00ba-4c2b-b7df-57791a56c0b5 destroying container for instance 8b805d51-4cb8-49ed-9e69-eabca4298cc6 2020-01-08T13:42:22.01+0530 [API/59] ERR Failed to stage build: staging failed 2020-01-08T13:42:22.54+0530 [STG/0] OUT Cell ce1f6b1b-00ba-4c2b-b7df-57791a56c0b5 successfully destroyed container for instance 8b805d51-4cb8-49ed-9e69-eabca4298cc6

srv\src\main\webapp\META-INF\context.xml:
<?xml version="1.0" encoding="UTF-8"?> <Context> <Resource name="jdbc/java-hdi-container" auth="Container" type="javax.sql.DataSource" testWhileIdle="true" factory="com.sap.xs.jdbc.datasource.tomcat.TomcatDataSourceFactory" service="${service_name_for_DefaultDB}" maxActive="500" tenantProvider="com.sap.excisetax.utilities.SubaccountIdSupplier" /> /> </Context>

Please help us resolve this issue. Let me know if any other information is required.

Thanks,
Gaurav

Path in mtad.yaml blocks discovery of package.json on CF

  • MBT Version: v0.3.2
  • OS Version: Win10
  • If possible, provide a link to the project.

I was looking for a while for why deploying a mtar file built with MBT results in an error complaining about that /home/vcap/app/package.json can not be found. It seems that MBT rewrites the "Path" parameter from the mta.yaml file in the mtad.yaml file within the mtar file, and this causes the issue. Can this be controlled/suppressed? If not, I would consider this to be a bug(?)

Difference from mta_archive_builder ?

I do not understand how this tool relates to the mta_archive_builder, and the compatibility of the mta.yaml made for the mta_archive_builder and the one for mbt.

When I execute mbt having a mta.yaml that properly works with the mta_archive_builder I get the error message:

mbt build -p CF
[2019-07-12 10:47:08]  INFO generating the "Makefile_20190712104708.mta" file...
Error: generation of the "Makefile_20190712104708.mta" file failed: generation of the "Makefile_20190712104708.mta" file failed when reading the MTA file: yaml: unmarshal errors:
  line 30: field command not found in type mta.Module

MTAR Build issues : Unable to build CAP Java Spring V4 Project

Do you want to request a feature or report a bug?
Report Bug

Please provide the following info:

C:\Users\i311690\git\VMSCAPGithub\vms>

  1. mbt build
  2. mbt build -p=cf
    3.mbt build -p=cf -t .

ERROR could not build the "vms-st-db" module: could not execute the "npm install --production" command: exec: "npm": executable file not found in %PATH%
make: *** [vms-st-db] Error 1
Error: could not build the MTA project: could not execute the "make -f Makefile_20191210153839.mta p=cf mtar= strict=true mode=" command: exit status 2

i think issue is with vms-st-db module in yaml . Please refer my yaml file & suggest if something is incorrect
https://github.wdf.sap.corp/itscb/VMSCAP/blob/master/vms/mta.yaml

Thanks,
Showkath.

Unable to run build, '@sap/[email protected]' is not in the npm registry.

Please provide the following info:

  1. Clone GIT to local repository
  2. Open command prompt in github\root
  3. run: mbt build -p=xsa
    C:\Users\i025126\OneDrive - SAP SE\Documents\GitHub\ROOT>mbt -v
    Cloud MTA Build Tool version 1.0.4
    C:\Users\i025126\OneDrive - SAP SE\Documents\GitHub\ROOT>mbt build
    [2019-12-13 15:21:52] INFO Cloud MTA Build Tool version 1.0.4
    [2019-12-13 15:21:52] INFO generating the "Makefile_20191213152152.mta" file...
    [2019-12-13 15:21:52] INFO done
    [2019-12-13 15:21:52] INFO executing the "make -f Makefile_20191213152152.mta p=cf mtar= strict=true mode=" command...
    [2019-12-13 15:21:52] INFO validating the MTA project
    [2019-12-13 15:21:52] INFO validating the MTA project
    [2019-12-13 15:21:52] INFO building the "db" module...
    [2019-12-13 15:21:52] INFO executing the "npm install --production" command...
    ....npm ERR! code E404
    npm ERR! 404 Not Found - GET https://registry.npmjs.org/@sap%2fhdi-deploy - Not found
    npm ERR! 404
    npm ERR! 404 '@sap/[email protected]' is not in the npm registry.
    npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
    npm ERR! 404 It was specified as a dependency of 'db'
    npm ERR! 404
    npm ERR! 404 Note that you can also install from a
    npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\i025126\AppData\Roaming\npm-cache_logs\2019-12-13T14_21_57_496Z-debug.log
[2019-12-13 15:21:57] ERROR could not build the "db" module: could not execute the "npm install --production" command: exit status 1
make: *** [Makefile_20191213152152.mta:37: db] Error 1
Error: could not build the MTA project: could not execute the "make -f Makefile_20191213152152.mta p=cf mtar= strict=true mode=" command: exit status 2

Attempt to install @sap/hdi-deploy have been done using
npm config set registry https://npm.sap.com/
C:\Users\i025126\OneDrive - SAP SE\Documents\GitHub\ROOT>npm install @sap/hdi-deploy
npm ERR! code E404
npm ERR! 404 Not Found - GET https://npm.sap.com/debug
npm ERR! 404
npm ERR! 404 '[email protected]' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\i025126\AppData\Roaming\npm-cache_logs\2019-12-13T14_25_20_483Z-debug.log
---- the log shows:
15 silly install loadAllDepsIntoIdealTree
16 silly resolveWithNewModule @sap/[email protected] checking installable status
17 http fetch GET 200 https://npm.sap.com/@sap%2fhana-client 75ms
18 silly pacote version manifest for @sap/[email protected] fetched in 78ms
19 http fetch GET 404 https://npm.sap.com/debug 56ms
---- and I get the fail
It seems that It tries to find either "@sap/hdi-deploy" or "debug" and depending the npm registry used one is always missing.

What is the trick

Best
Søren

Docker: create v1.0.0 tag

In DockerHub there is a container tagged with latest containing the version 1.0.0 of CloudMBT. However, a tag named 1.0.0 to the same container is missing.

Fiori Launchpad Site not being created due to error in AppRouter Deployment

Hello Colleagues,
I am trying to Build a Fiori Launchpad site on Cloud Foundry using Application Programming Model.
I have created a SAP Business Cloud Application in WEBIDE Full Stack and deploying to CF canary account. This Application contains a JAVA module to create an ODATA service endpoint, HTML5 module and a Fiori launchpad site.
There are technical errors during deployment of the Application.

Following are the steps followed and the error which is occurring during deployment:

  1. Creation of SAP Business service Application( with the option to add HTML5 repository checked during creation).
  2. Added HTML5 Module.
  • Created a navigation in manifest.json of HTML5 App
    image
  1. Added Portal services subscription to my Cloud foundry account.
  2. Added SAP Fiori Launchpad site Module to my project.
  • Changes done in the ComonDataModel.json file to added the tile created in step2.
    image
  1. Built the Project
    Tried to Deploy the project where I am having technical errors:
    image.

following are the files having complete logs:

MAIN_LOG.txt
CH_DEMO_PROJ_appRouter.txt

Could you please assist me in resolving the issue?

Thanks,
Chaitra

Could not build MTA project via Windows CMD but via Git Bash it works

Environment info:

  • MBT Version: 1.0.7 (installed via npm)
  • GNU Make 4.2.1 Built for Windows32
  • OS Version: Microsoft Windows 10 Enterprise (Version 10.0.17763 Build 17763)

Steps to Reproduce:

  1. When I run mbt build via Windows CMD the build crashes with following error message:
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.865 s
[INFO] Finished at: 2020-01-08T17:09:29+01:00
[INFO] ------------------------------------------------------------------------
[2020-01-08 17:09:29]  INFO the build results of the "bank-mock-service" module will be packed and saved in the "C:\Users\XXX\IdeaProjects\bankmockservice\.bankmockservice_mta_build_tmp\bank-mock-service" folder
INFO finished building the "bank-mock-service" module
INFO generating the metadata...
INFO generating the MTA archive...
ERROR could not generate the MTA archive when archiving: CreateFile C:\Users\XXX\IdeaProjects\bankmockservice --mtar=.\.bankmockservice_mta_build_tmp: The system cannot find the path specified. 
make: *** [Makefile_20200108170857.mta:50: mtar] Error 1
Error: could not build the MTA project: could not execute the "make -f Makefile_20200108170857.mta p=cf mtar=. strict=true mode=" command: exit status 2
  1. When I run the same command from Git Bash command line, the build is succesful.\
  2. When my collegue runs the same command from Windows CMD on his computer, everything works fine.

Bundle GNU Make with MBT when installing via NPM

As a user, when installing the mbt via npm, I expect npm to install all dependencies necessary to run the mbt -- this is the case with basically all packages I install through npm and one of the main reasons to use a package and dependency management tool.

However, I found that GNU Make, a main dependency of mbt, is not installed automatically. I understand there may be some room for discussion due to the GNU project's stricter licences, but even though it's a one-time thing (I understand make isn't updated very frequently), the guidelines in the documentation are not very convincing: Either install yet another package manager (I've never heard of) to get the binary, or download it from some guy's private GitHub page (32 stars) without any means to verify its correctness. Building from source is also not an option for me.

Please consider bundling GNU Make with the MBT at least during installation through NPM, as this is what any user expects and as it avoids any additional (and imo somewhat shady) means of acquiring and installing a version of make.

Thank you very much!

Cannot add node_modules on mac os

Unable to generate a mtar using MTB if the module contains a node_modules directory. If the directory is removed, the command works.

Please provide the following info:

Steps to Reproduce:

  1. Clone the project https://github.com/olirogers/mbt-test

  2. Run npm install to create node_modules directories. From the root dir:
    npm install
    cd srv && npm install

  3. Run mbt from the root dir: mbt build

Output is:

>> mbt build
[2019-11-02 19:35:32]  INFO generating the "Makefile_20191102193532.mta" file...
[2019-11-02 19:35:32]  INFO done
[2019-11-02 19:35:32]  INFO executing the "make -f Makefile_20191102193532.mta p=cf mtar= strict=true mode=" command...
[2019-11-02 19:35:32]  INFO validating the MTA project
[2019-11-02 19:35:32]  INFO validating the MTA project
[2019-11-02 19:35:32]  INFO building the "mbt-srv" module...
[2019-11-02 19:35:32]  INFO the build results of the "mbt-srv" module will be packed and saved in the "/Users/<user>/git/mbt-test/.mbt-test_mta_build_tmp/mbt-srv" folder
[2019-11-02 19:35:32] ERROR could not pack the "mbt-srv" module when archiving: stat ../mime/cli.js: no such file or directory
make: *** [mbt-srv] Error 1
Error: could not build the MTA project: could not execute the "make -f Makefile_20191102193532.mta p=cf mtar= strict=true mode=" command: exit status 2

This is the same result as using the npm builder.

If you delete the srv/node_modules folder, or exclude the folder, all is successful!

Any ideas?

Docker: grunt not in path

When building a project containing a module using the @sap/grunt-sapui5-bestpractice-build plugin and the grunt builder, grunt is not found during the build.

ERROR could not build the "my-ui" module: could not execute the "grunt" command: exec: "grunt": executable file not found in $PATH

However,grunt is installed in <module>/node_modules/.bin/ and with the old build tool it was suficiend to build with PATH=./node_modules/.bin:$PATH.
So it looks like previously the build was executed in the module path where ./node_modules/.bin points to the correct directory which is not the case any longer.

Please provide the following info:

  • MBT Version: 1.0.0
  • OS Version: provided in container
  • If possible, provide a link to the project. (contact me)

Steps to Reproduce:

  1. start devxci/mbtci
  2. run export PATH=./node_modules/.bin:$PATH mbt build --platform cf

One solution could be to install NPM's grunt-cli to detect the nearest grunt executable.

Using an MTA extension takes over extension Id as artifact ID

We have switched to using the new MTA builder in our XMake build.
We specify an additional MTA extension for the MTA build. It looks the Id of the extension overrules the Id which is used as Maven artifact Id for pushing it to Nexus. Thus the Nexus link for downloading the file changes unexpectedly.

The following is the .xmake config:
[buildplugin]
name=mta
mbt-v2=true
mta-version=latest
mta-group-artifact=com.sap.mta:mta_archive_builder

mtar-group=com.sap.uics
mtar-build-target=CF
maven-version=3.3.3
maven-group-artifact=org.apache.maven:apache-maven
mta-extension=mtaExtensions/xmake.release.mtaext.yaml
java-version=1.8.0_172-sap-01
node-version=10.15.3
no-proxy=true

Inside the mta.yaml we have ID: fdc-cf-service
The extension file contains
extends: fdc-cf-service
ID: fdc-cf-service.xmake

When staging the xmake build the expected url would be
http://nexus.wdf.sap.corp:8081/stage/repository/28b650c48095-releases-20200121-072454593-331/com/sap/uics/fdc-cf-service/1.19.13-B-20200121072323+080e261d174e2232ab4dd8d4312bddb6b6bec325/fdc-cf-service-1.19.13-B-20200121072323+080e261d174e2232ab4dd8d4312bddb6b6bec325.mtar
But instead it produced
http://nexus.wdf.sap.corp:8081/stage/repository/28b650c48095-releases-20200121-072454593-331/com/sap/uics/fdc-cf-service.xmake/1.19.13-B-20200121072323%2B080e261d174e2232ab4dd8d4312bddb6b6bec325/fdc-cf-service.xmake-1.19.13-B-20200121072323%2B080e261d174e2232ab4dd8d4312bddb6b6bec325.pom

With the old build tool this did not happen.

You can find the Git source here: https://github.wdf.sap.corp/UI-related-Cloud-Services/fdc-cf

Using npm ci with the build tool

Do you want to request a feature or report a bug?

Please provide the following info:

  • MBT Version: 0.3.2
  • OS Version: win10
  • If possible, provide a link to the project.

Steps to Reproduce:

We are working with the new tool for a few weeks, and it's a big step forward, we notice performance improvement for our builds by 30-40% which is very surprising, this is great!
The make integration is great as we are able to extend with our new commands, e.g., we change the npm install production to npm ci which also give a boost to our builds, my question is if there is a way that we all benefit from it, I mean other teams will inherit our changes ? otherwise we will use a lot of boilerplate that we want to avoid.

Thank you

Make fails with no error message

Do you want to request a feature or report a bug?

Please provide the following info:

  • MBT Version:
  • OS Version:
  • If possible, provide a link to the project.

Steps to Reproduce:

  1. 1.0.5
  2. Win10
mbt build
[2019-12-18 14:57:01]  INFO Cloud MTA Build Tool version 1.0.5
[2019-12-18 14:57:01]  INFO generating the "Makefile_20191218145701.mta" file...
[2019-12-18 14:57:01]  INFO done
[2019-12-18 14:57:01]  INFO executing the "make -f Makefile_20191218145701.mta p=cf mtar= strict=true mode=" command...
Error: could not build the MTA project: could not execute the "make -f Makefile_20191218145701.mta p=cf mtar= strict=true mode=" command: exit status 3221225781

There is no information what the issue could be. Make is meanwhile on the path.

Add a option to skip the "install" step

Many of the developers I speak to "complain" that the MTA archive for nodesjs-based projects become really large. A simple CAP project for example already comes >90MB.

This happens due to the large size of the node_modules folder. I guess it should be possible to create the archive without the node_modules folder. This would have the benefit of saving time during the build and upload step. It would also come with the price that the modules will have to be downloaded during the deployment (e.g. this step will take longer).

I think it would make sense to leave this decision (whether to include the node_modules to the archive) up to the developers and offer them an opt-out parameter.

.DS_Store file got packed into mtar

When build using the tool, it appears the .DS_Store file will also be packed into the final mtar file. Then when deploying the created mtar to SCP CF, the deployment failed with error

Error: Adding "cfg/.DS_Store" for deploy... failed [8211700] (STDOUT, APP/TASK/deploy)#

Please provide the following info:

  • MBT Version: 1.0.7
  • OS Version: Mac OS Mojava 10.14.6

Steps to reproduce:

  1. Run mbt build to build mtar
  2. Run cf deploy created.mtar

More logs for the deploy:
#2.0#2020 01 07 05:39:35.559#Z#DEBUG#com.sap.cloud.lm.sl.xs2.db.executeTaskTask#
######com.sap.cloud.lm.sl.cf.persistence.services.ProcessLogger########flowable-async-job-executor-thread-6###
[PollExecuteTaskStatusExecution] [Tue Jan 07 05:39:32 UTC 2020] [2020-01-07 05:39:32.275169000] Error: Adding "cfg/.DS_Store" for deploy... failed [8211700] (STDOUT, APP/TASK/deploy)#

#2.0#2020 01 07 05:39:35.559#Z#DEBUG#com.sap.cloud.lm.sl.xs2.db.executeTaskTask#
######com.sap.cloud.lm.sl.cf.persistence.services.ProcessLogger########flowable-async-job-executor-thread-6###
[PollExecuteTaskStatusExecution] [Tue Jan 07 05:39:32 UTC 2020] at "cfg/.hdiconfig" (0:0) (STDOUT, APP/TASK/deploy)#

#2.0#2020 01 07 05:39:35.560#Z#DEBUG#com.sap.cloud.lm.sl.xs2.db.executeTaskTask#
######com.sap.cloud.lm.sl.cf.persistence.services.ProcessLogger########flowable-async-job-executor-thread-6###
[PollExecuteTaskStatusExecution] [Tue Jan 07 05:39:32 UTC 2020] [2020-01-07 05:39:32.275144000] Error: "cfg/.hdiconfig": Configuration does not define a build plugin for file suffix "ds_store" [8210015] (STDOUT, APP/TASK/deploy)#

#2.0#2020 01 07 05:39:35.560#Z#DEBUG#com.sap.cloud.lm.sl.xs2.db.executeTaskTask#
######com.sap.cloud.lm.sl.cf.persistence.services.ProcessLogger########flowable-async-job-executor-thread-6###
[PollExecuteTaskStatusExecution] [Tue Jan 07 05:39:32 UTC 2020] at "cfg/.DS_Store" (0:0) (STDOUT, APP/TASK/deploy)#

#2.0#2020 01 07 05:39:35.560#Z#DEBUG#com.sap.cloud.lm.sl.xs2.db.executeTaskTask#
######com.sap.cloud.lm.sl.cf.persistence.services.ProcessLogger########flowable-async-job-executor-thread-6###
[PollExecuteTaskStatusExecution] [Tue Jan 07 05:39:32 UTC 2020] [2020-01-07 05:39:32.275124000] Error: "cfg/.DS_Store": could not create a compile unit for the file [8211714] (STDOUT, APP/TASK/deploy)#

#2.0#2020 01 07 05:39:35.560#Z#DEBUG#com.sap.cloud.lm.sl.xs2.db.executeTaskTask#
######com.sap.cloud.lm.sl.cf.persistence.services.ProcessLogger########flowable-async-job-executor-thread-6###
[PollExecuteTaskStatusExecution] [Tue Jan 07 05:39:32 UTC 2020] [2020-01-07 05:39:32.260891000] Adding "cfg/.DS_Store" for deploy... (STDOUT, APP/TASK/deploy)#

Fails with latest node version

Running the make process fails with the latest node version. The setup worked with an older node version

Please provide the following info:

Steps to Reproduce:

  1. create project
  2. mbt init
  3. make -f Makefile.mta p=cf
[2019-05-17 18:08:35]  INFO validating the MTA project
[2019-05-17 18:08:35]  INFO validating the MTA project
[2019-05-17 18:08:35]  INFO building the "beershop-db" module...
[2019-05-17 18:08:35]  INFO executing the [npm install] command...
..
> @sap/[email protected] install /Users/d056949/Desktop/beershop/db/node_modules/@sap/hdi-deploy/node_modules/@sap/hana-client
> node build.js

..Error: Command failed: node-gyp build
In file included from ../src/hana.cpp:5:
../src/h/hana_utils.h:298:11: error: no template named 'Handle'
                        Handle<Value>                           arg,
                        ^
../src/h/hana_utils.h:301:6: error: redefinition of 'getBindParameters' as different kind of symbol
bool getBindParameters( Handle<Value>                           arg,
     ^
../src/h/hana_utils.h:294:6: note: previous definition is here
bool getBindParameters( std::vector<char*>                      &string_params,
     ^
../src/h/hana_utils.h:301:25: error: use of undeclared identifier 'Handle'
bool getBindParameters( Handle<Value>                           arg,
                        ^
../src/h/hana_utils.h:301:32: error: 'Value' does not refer to a value
bool getBindParameters( Handle<Value>                           arg,
                               ^
/Users/d056949/.node-gyp/12.2.0/include/node/v8.h:2240:17: note: declared here
class V8_EXPORT Value : public Data {
                ^
In file included from ../src/hana.cpp:5:
../src/h/hana_utils.h:301:43: error: use of undeclared identifier 'arg'
bool getBindParameters( Handle<Value>                           arg,
                                                                ^
../src/h/hana_utils.h:302:65: error: expected '(' for function-style cast or type construction
                        int                                     row_param_count,
                        ~~~                                     ^
../src/h/hana_utils.h:303:65: error: expected '(' for function-style cast or type construction
                        std::vector<dbcapi_bind_data*>          &params,
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~          ^
../src/h/hana_utils.h:303:66: error: use of undeclared identifier 'params'
                        std::vector<dbcapi_bind_data*>          &params,
                                                                 ^
../src/h/hana_utils.h:304:45: error: expected '(' for function-style cast or type construction
                        std::vector<size_t> &                   buffer_size );
                        ~~~~~~~~~~~~~~~~~~~ ^
../src/h/hana_utils.h:304:63: error: use of undeclared identifier 'buffer_size'
                        std::vector<size_t> &                   buffer_size );
                                                                ^
../src/h/hana_utils.h:310:26: error: use of undeclared identifier 'Handle'
bool getInputParameters( Handle<Value>                      arg,
                         ^
../src/h/hana_utils.h:310:33: error: 'Value' does not refer to a value
bool getInputParameters( Handle<Value>                      arg,
                                ^
/Users/d056949/.node-gyp/12.2.0/include/node/v8.h:2240:17: note: declared here
class V8_EXPORT Value : public Data {
                ^
In file included from ../src/hana.cpp:5:
../src/h/hana_utils.h:310:61: error: use of undeclared identifier 'arg'
bool getInputParameters( Handle<Value>                      arg,
                                                            ^
../src/h/hana_utils.h:311:57: error: expected '(' for function-style cast or type construction
                         std::vector<dbcapi_bind_data*> &   params,
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
../src/h/hana_utils.h:311:61: error: use of undeclared identifier 'params'
                         std::vector<dbcapi_bind_data*> &   params,
                                                            ^
../src/h/hana_utils.h:312:26: error: unexpected type name 'dbcapi_stmt': expected expression
                         dbcapi_stmt *                      stmt,
                         ^
../src/h/hana_utils.h:312:61: error: use of undeclared identifier 'stmt'; did you mean 'stat'?
                         dbcapi_stmt *                      stmt,
                                                            ^~~~
                                                            stat
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/stat.h:361:9: note: 'stat' declared here
int     stat(const char *, struct stat *) __DARWIN_INODE64(stat);
        ^
In file included from ../src/hana.cpp:5:
../src/h/hana_utils.h:313:30: error: expected '(' for function-style cast or type construction
                         int &                              errCode,
                         ~~~ ^
../src/h/hana_utils.h:313:61: error: use of undeclared identifier 'errCode'; did you mean 'strmode'?
                         int &                              errCode,
                                                            ^~~~~~~
                                                            strmode
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/string.h:164:7: note: 'strmode' declared here
void     strmode(int __mode, char *__bp);
         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[1]: *** [Release/obj.target/hana-client/src/hana.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/d056949/.nvm/versions/node/v12.2.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:257:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/Users/d056949/.nvm/versions/node/v12.2.0/bin/node" "/Users/d056949/.nvm/versions/node/v12.2.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build"
gyp ERR! cwd /Users/d056949/Desktop/beershop/db/node_modules/@sap/hdi-deploy/node_modules/@sap/hana-client
gyp ERR! node -v v12.2.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 

    at ChildProcess.exithandler (child_process.js:304:12)
    at ChildProcess.emit (events.js:196:13)
    at maybeClose (internal/child_process.js:1011:16)
    at Socket.<anonymous> (internal/child_process.js:416:11)
    at Socket.emit (events.js:196:13)
    at Pipe.<anonymous> (net.js:586:12) {
  killed: false,
  code: 1,
  signal: null,
  cmd: 'node-gyp build'
}   CXX(target) Release/obj.target/hana-client/src/hana.o

npm WARN deploy@ No description
npm WARN deploy@ No repository field.
npm WARN deploy@ No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! @sap/[email protected] install: `node build.js`
npm ERR! Exit status 255
npm ERR! 
npm ERR! Failed at the @sap/[email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/d056949/.npm/_logs/2019-05-17T16_08_39_826Z-debug.log
[2019-05-17 18:08:39] ERROR build of the "beershop-db" module failed when executing commands: execution of the "/Users/d056949/.nvm/versions/node/v12.2.0/bin/npm" command failed while waiting for finish: exit status 255
make: *** [beershop-db] Error 1

Issue running mta build on our mta project

Hello Team,

We would like to switch from our mta archive builder to new cloud mta build tool.
We are currently building .mtar files using mta archive builder.

I followed the steps in the manual to download and install the cloud mta build tool and GNU Make in my windows system. Then set GNU make to my PATH environment variables.

https://sap.github.io/cloud-mta-build-tool/download/

The link to our mta.yaml file https://github.wdf.sap.corp/CSI/outbound/blob/master/mta.yaml
On running the mbt build command, we get the following error.

[2019-09-20 11:05:26] INFO generating the "Makefile_20190920110526.mta" file...
[2019-09-20 11:05:26] INFO done
[2019-09-20 11:05:26] INFO executing the "make -f Makefile_20190920110526.mta p=cf mtar= strict=true mode=" command...
[2019-09-20 11:05:28] INFO validating the MTA project
[2019-09-20 11:05:28] ERROR the "mta.yaml" file is not valid:
line 60: the "outbound-service" provided property set name is already in use; a module was found with the same name on line 46
make: *** [Makefile_20190920110526.mta:30: pre_validate] Error 1
Error: could not build the MTA project: could not execute the "make -f Makefile_20190920110526.mta p=cf mtar= strict=true mode=" command: exit status 2

Best Regards
Abhishek

docs(usage): correct target help text

The provided help text seems to be wrong:

  -t, --target string        The path to the results folder; the current path is set as the default

Actually the default folder is ./mta_archives

In the docs it's saying this which is more accurate:

The folder for the generated MTAR file. If this parameter is not provided, the MTAR file is saved in the mta_archives subfolder of the current folder. If the parameter is provided, the MTAR file is saved in the root of the folder provided by the argument.

Please provide the following info:

  • Used Container: devxci/mbtci:1.0.4
  • MBT Version: as provided in Docker
  • OS Version: as provided in Docker

Steps to Reproduce:

  1. run mbt build --help

Issue on mbt build with space in path

Please provide the following info:

  • MBT Version: 0.3.2
  • OS Version: Win10

In my project, we use mbt and it works fine. However, for a quick check, I cloned the project again on my Desktop, where the build failed due to One Drive having spaces in the path: C:\Users\xxx\OneDrive - xxx\Desktop\test.

> mbt build -p=CF

[2019-10-22 09:47:47]  INFO generating the "Makefile_20191022094747.mta" file...
[2019-10-22 09:47:47]  INFO done
[2019-10-22 09:47:47]  INFO executing the "make -f Makefile_20191022094747.mta p=CF mtar= strict=true mode=" command...
/usr/bin/sh: C:/Users/d062651/OneDrive: Is a directory
make: *** [Makefile_20191022094747.mta:30: pre_validate] Error 126
Error: could not build the MTA project: could not execute the "make -f Makefile_20191022094747.mta p=CF mtar= strict=true mode=" command: exit status 2

I have a workaround, which is copying the project to another directory not managed by onedrive, but I guess this is something you'd want fixed.

I don't know whether this affects the issue, but I'm using Git Bash as Shell / Terminal Emulator. (Edit: Occurs in Powershell as well)

Thanks!

Parameter "active" in mta.yaml is ignored

  • MBT Version: Cloud MTA Build Tool version 1.0.5
  • OS Version: Ubuntu 18.04.3 LTS
  • If possible, provide a link to the project.

Steps to Reproduce:

  1. Add a parameter "active: false" to a resource in mta.yaml
  2. Build an mtar file (mbt build --mtar output.mtar)
  3. In the resulting mtar, META-INF/mtad.yaml does not contain the "active" parameter

This happens regardless of the _schema-version specified in mta.yaml (2.0, 3.1.0, 3.2.0)

MBT command instead of make

Hi,

I really like this tool and I also like the integration of make.
When I showed this tool to developers out there, they told me that make is kind of hard for them to install (especially for Windows users).
They like how easy it is to install mbt with npm.

Would it be possible to provide one mbt command that combines mbt init and make ...?

BUG - "Unsupported resource type "" for platform type "CLOUD-FOUNDRY"

Dear Colleagues
using https://github.com/SAP/generator-easy-ui5 the mta.yaml that it produces builds and deploys fine. Itself is using mbt.

However, if one has an mta.yaml such as the following

https://github.com/lucatoldo/5-simple-steps-to-wrap-a-rest-service-with-a-nice-ui5/blob/master/com.restapiexample.dummy.dummyUI/mta.yaml

Then mbt is returning the bug in the subject.

However, when using instead
java -jar mta_archive_builder-1.1.19.jar --build=CF build
cf deploy my.mtar

then everything works fine.

Could you please check the difference and fix your tool ?
THanks

Unable to create proper mtar

I'm switching from Multitarget Application Archive Builder to Cloud mta build tool.
I have a project html5 that was deployed before in SAP CP Neo. Before I was able to have the mtar generated and deployed to NEO.
With the new mbt build the mtar is generated but contains only a META-INF folder which contains only one MANIFEST.MF and mtad.yaml files. The rest of my dist files are not part of the package.
Am I missing something !? Should I not have the dist files somehow in the generated mtar. I'm using 'latest' as the version.

Thanks,
Adrian

Unable to refer artifact from a directory above the root directory in path parameter

My mta file is stored in A/B/mta.yaml

For a service instance, I need to refer a file A/xs-security.json.

I have provided the path parameter as
path
-../xs-security.json

But this isn't working.
I can't see the xs-security.json in the archive file. Also when I am trying to deploy the file I am getting the following error:
must use only Unix separators "/", but contains Windows separators "\"

This is weird as I am using "/" and not ""

build failed on webide but success on windows/mac

I can use latest mta tool version 0.3.7 on windows and on Mac to build my project successful, but when I build the same project ( https://github.wdf.sap.corp/CPES/ipd.cf.eadPoc ) on webIde (https://webidecp-fiori.dispatcher.int.sap.eu2.hana.ondemand.com/), it report following error:

5:51:32 PM (Executor) [2019-11-13 09:51:32] INFO the build results of the "ipde-srv" module will be packed and saved in the "/projects/ipd.cf.eadPoc/.ipd.cf.eadPoc_mta_build_tmp/ipde-srv" folder
5:51:32 PM (Executor) [2019-11-13 09:51:32] INFO generating the metadata...
5:51:32 PM (Executor) [2019-11-13 09:51:32] INFO generating the MTA archive...
5:51:38 PM (Executor) [2019-11-13 09:51:38] INFO the MTA archive generated at: /projects/ipd.cf.eadPoc/mta_archives/ipde_1.1.0.mtar
5:51:38 PM (Executor) [2019-11-13 09:51:38] INFO cleaning temporary files...
5:51:38 PM (Executor) /usr/local/scripts/mbt/webide_mbt_build.sh: line 105: [: mta_archives/ipde: binary operator expected
5:51:38 PM (Executor) zip warning: name not matched: mta_archives/ipde
5:51:38 PM (Executor) zip warning: name not matched: "eadesigner-backend"_1.1.0.mtar
5:51:38 PM (Executor)
5:51:38 PM (Executor) zip error: Nothing to do! (try: zip -r mta_archives/mta_archives.zip . -i mta_archives/ipde "eadesigner-backend"_1.1.0.mtar)
5:51:38 PM (Executor) ERROR:The build of project ipde "eadesigner-backend" failed, (Error Code=12, Error Msg=Failed to compress the mta_archives/ipde "eadesigner-backend"_1.1.0.mtar source file to the mta_archives/mta_archives.zip .zip file.)
5:51:38 PM (Executor) ERROR:Function call stack
5:51:38 PM (Executor) exitOnError
5:51:38 PM (Executor) zipFile
5:51:38 PM (Executor) main

Conflict between project name and "provides" name

  • MBT Version: 1.0.0

Hi,

There is a mta.yaml file containing the following part:

(line 35) - name: project-ui-deployer
type: com.sap.html5.application-content
path: ui/project-ui-deployer/
parameters:
memory: 512M
disk-quota: 512M
buildpack: https://github.com/cloudfoundry/nodejs-buildpack.git#v1.6.49
requires:
- name: project-ui-host
build-parameters:
requires:
- name: project-ui
artifacts:
- './*'
target-path: resources/project-ui
provides:
(line 51) - name: project-ui-deployer
public: true

mbt complains that the project name and the provides are the same:
line 51: the "project-ui-deployer" provided property set name is already in use; a module was found with the same name on line 35

In my view it should be legitimate to have the two names the same - one is the name of a project, the other is the name of the built artifact, as I understand.

False Positive during validation of deployment descriptor extension

  • MBT Version: 0.3.2
  • OS Version: Win 10
  • If possible, provide a link to the project.
    (sap internal project) I can provide a link to a colleage via internal channels, though.

Steps to Reproduce:

  1. Create a simple mtad.yaml
  2. Create an mtad.mtaext
  3. mbt validate -s . -d dep -e mtad.mtaext

Result:

[2019-10-11 11:58:09] INFO validating the MTA project
[2019-10-11 11:58:10] ERROR the "mtad.mtaext" file is not valid:
line 7: field type not found in type mta.ResourceExt

The mtaext schema specifies a type field for resources, though.

mtad.yaml

_schema-version: "3.3"
ID: com.sap.example
version: 0.0.5

mtad.mtaext

_schema-version: "3.3"
ID: com.sap.example.ext
extends: com.sap.example

resources:
  - name: example_resource
    type: org.cloudfoundry.managed-service
    parameters:
      service: some_service
      service-plan: some_plan

Regards
Sacha

MTAR fetcher builder issue

  • MBT Version: MBT version v0.2.12
  • OS Version: macOS Mojave (10.14.5)

While trying to do mta build encountering the issue.

Error:

fetcherissue

Command used to build : mbt build -p=cf

mta.yml config file :

_schema-version: 3.1
ID: policy-service
version: 1.0.0
 
 
modules:
 
- name: mtar-les-admin-objectstore
  type: java
  path: policy/objectstore/
  parameters:
    buildpack: sap_java_buildpack
  build-parameters:
   builder: fetcher
   fetcher-opts:
         repo-type: maven
         repo-coordinates: com.sap.iot.edgeservices:onboard:3.1909.0 

could not build the MTA project: could not execute the makefile

Do you want to request a feature or report a bug?

Please provide the following info:

  • MBT Version: Cloud MTA Build Tool version 1.0.4
  • OS Version: MAC 10.15.2
  • If possible, provide a link to the project.

Steps to Reproduce:

  1. I set up abt tool in my Mac
  2. I copied the mta.yaml from mtad.yaml from assembly-cf folder to parent folder.
  3. When I run the following command to build end up with error as follows

C02V64XYHTD6:baseline I319505$ mbt build -p cf
[2019-12-13 14:43:34] INFO Cloud MTA Build Tool version 1.0.4
[2019-12-13 14:43:34] INFO generating the "Makefile_20191213144334.mta" file...
[2019-12-13 14:43:34] INFO done
[2019-12-13 14:43:34] INFO executing the "make -f Makefile_20191213144334.mta p=cf mtar= strict=true mode=" command...
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: could not build the MTA project: could not execute the "make -f Makefile_20191213144334.mta p=cf mtar= strict=true mode=" command: exit status 1

Deployment failing after moving to new MBT

Link to application: https://github.wdf.sap.corp/S4HANA-Procurement-GB/GB

Steps to Reproduce:
After the movement the compilation went through but the deployment is failing.
Error: 2019-12-24T04:17:05.671+0000 [STG/0] ERR SEVERE: Unhandled exception in Buildpack main method: None of the available runtimes: [Tomee, Tomee7, Tomcat, Java Main] support the application in the specified path. Failed to compile droplet: Failed to compile droplet: exit status 9

Please help us resolve this issue

MBT fails on directory symlinks (win10)

Please provide the following info:

  • MBT Version: v0.3.1
  • OS Version: win10 1809

When building an MTA project containing directory symlinks, the process aborts with error message

ERROR could not pack the "<module name>" module when archiving: read <symlink>: The handle is invalid.

The symlink is valid, though...

Not able to resolve variable from xs-security.json

  • MBT Version: 0.3.2

Steps to Reproduce:

file: mta.yaml

resources:

  • name: test-uaa
    type: com.sap.xs.uaa
    parameters:
    default-xsappname: test-ax-xsapp
    path: ./xs-security.json
    service: xsuaa
    service-plan: broker

File: xs-security.json
{
"xsappname": "${default-xsappname},
"tenant-mode": "dedicated",
"scopes": [{

when build default-xsappname does not resolve and throw below error, if we give xsappname directly it will work

Service operation failed: Controller operation failed: 502 Updating service "test-uaa" failed: Bad Gateway: Error creating service "test-uaa" from offering "xsuaa" and plan "broker": Service broker error: Service broker xsuaa failed with: Error creating application null (Error parsing xs-security.json data: Inconsistent xs-security.json: Invalid xsappname "$default-xsappname": May only include characters 'a'-'z', 'A'-'Z', '0'-'9', '_', '-', '', and '/'.)

Could not build the MTA project

BUG

Steps to Reproduce:

  1. Clone the repository from the aforementioned GitHub url
  2. Install Node modules
  3. Execute npm run build:mta

The execution fails complaining:

''C:' is not recognized as an internal or external command,
operable program or batch file.
make: *** [pre_validate] Error 1
Error: could not build the MTA project: could not execute the "make -f Makefile_20191223164421.mta p=cf mtar= strict=true mode=" command: exit status 2

Command output attached.
build.log

Kind Regards

Serdar

Docker: npm.sap.com not accessible

Inside the Docker container npm.sap.com is not accessible due to an SSL. Issue and solution are also described in SAP/devops-docker-node-browsers#10 (comment).

Please provide the following info:

  • MBT Version: as provided in Docker
  • OS Version: as provided in Docker 1.0.1

Steps to Reproduce:

  1. start container: docker run -it devxci/mbtci:1.0.1 bash
  2. execute inside of container: cd ~ && npm install @sap/cds

current result:

npm ERR! code EPROTO
npm ERR! errno EPROTO
npm ERR! request to https://npm.sap.com/@sap%2fcds failed, reason: write EPROTO 140137535555456:error:1414D172:SSL routines:tls12_check_peer_sigalg:wrong signature type:../deps/openssl/openssl/ssl/t1_lib.c:1111:
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mta/.npm/_logs/2019-11-28T12_56_02_985Z-debug.log

expected result:

NEO cli deploy-mta command fails after switch to Cloud MTA build tool

Hi Colleagues,

Due to the deprecation of MTA Archive builder tool we had to switch to the new Cloud MTA build tool. I did this yesterday following the migration guide here https://sap.github.io/cloud-mta-build-tool/migration/#features-that-are-handled-differently-in-the-cloud-mta-build-tool. So now the project is building fine and the mtar is being generated but when trying to deploy the generated mtar to SCP neo via NEO CLI deploy-mta command it is failing with:

Deployment operation with id 'i10073' started. 11:49:05 Start deploying MTA archive 'com.sap.ibso.daikin.portal.deliveries_1.0.0.mtar' 11:49:05 (!) ERROR: Deploying MTA archive 'com.sap.ibso.daikin.portal.deliveries_1.0.0.mtar' failed: 'Invalid MTA archive [com.sap.ibso.daikin.portal.deliveries_1.0.0.mtar]. MTA deployment descriptor (META-INF/mtad.yaml) could not be parsed. For more information, see the troubleshooting section of the official documentation in the SAP Help Portal about resolving descriptor errors. Technical details: Invalid module [portal-deliveries] of type [com.sap.hcp.html5]: Parameter [name] is required and must have value.' 11:49:05 MTA archive 'com.sap.ibso.daikin.portal.deliveries_1.0.0.mtar' deployment finished
The strange thing is that the module name is exactly the same as before when the deployment was working when the mtar was built with the old tool.

For completeness i am passting the content of mta.yaml file old and new version:

  • old
_schema-version: "2.1"
ID: com.sap.ibso.daikin.portal.deliveries
version: 1.0.0
description: "Portal app for viewing deliveries information."

parameters:
  hcp-deployer-version: "1.1.0"

modules:
  - name: "portal-deliveries"
    type: html5
    path: .
    parameters:
      version: 1.0.0-${timestamp}
    build-parameters:
      builder: grunt
      grunt-opts:
        - test
        - --code-coverage
        - --force
        - build
        - regex-replace
      build-result: dist/portal-deliveries
  • new
_schema-version: "2.1"
ID: com.sap.ibso.daikin.portal.deliveries
version: 1.0.0
description: "Portal app for viewing deliveries information."

parameters:
  hcp-deployer-version: "1.1.0"

modules:
  - name: "portal-deliveries"
    type: html5
    path: .
    parameters:
      version: 1.0.0-${timestamp}
    build-parameters:
      builder: custom
      commands:
        - npm install
        - grunt test --code-coverage --force build regex-replace
        - npm prune --production
      build-result: dist

Could you please advice what could be the issue here?

Migration to MBT v2: what to do with mtad.yaml

This is neither a feature nor a bug, but rather a question on how to solve an issue. As I couldn't find neither a Slack channel nor a similar mean, I'm falling back in here.

I'm currently migrating to MBT v2 by following this article.

I moved a module of type "com.sap.html5.application-content" into a just created mtad.yaml, that looks like the following:

_schema-version: '3.3.0'
ID: com.sap.my-app-path
version: 1.8.0-SNAPSHOT
modules:
  - name: my-app-deployer
    type: com.sap.html5.application-content
    parameters:
      memory: 256M
      path: deployer
    build-parameters:
      type: com.sap.html5.application-content
      builder: grunt
      requires:
        - name: my-app
    requires:
      - name: my-app-app-host

But I don't know what more I should do with this mtad.yaml, as I couldn't find any documentation regarding to how to enable it so it's used during building. For instance: should I setup anywhere to call mbt assemble? Should we add some variable or another configuration? It's unclear how to "give life" to this file in my build pipeline.

  • MBT Version: 2+
  • OS Version: Linux used xMake Nova
  • Link to the project: this is a SAP internal project. I can provide link via private message.

unzip and run

I have a Scala application with very large set of dependencies.
I would like to be able to build a zip file with the current directory, upload it to cf, then unzip it and then execute a specific long command that starts the service.
For example
java -cp /blabla/1.jar:/blabla/2.jar my.class --home=/blabla

mbt build failed with time-out

I tried to build a repository with mbt build. At one module, the npm install ended in a time-out.
Manual execution of npm install in the same module was successful. There were no log files provided.

SOLUTION: In the .npmrc-file of the user, there was another registry link written down. After removing that one, the build went further

Suggestion: Provide any sort of logs in this step, to retrace the problem better

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.