├── node-rfc ├── nwrfcsdk.conf ├── package.json ├── cts ├── Dockerfile ├── README.md └── run_rfc_task.js ├── .gitignore ├── .github └── workflows │ ├── reuse.yaml │ ├── release.yml │ └── push.yml ├── jacoco-cli ├── Dockerfile └── README.md ├── CONTRIBUTING.md ├── .reuse └── dep5 ├── README.md ├── LICENSES └── Apache-2.0.txt └── LICENSE /node-rfc/nwrfcsdk.conf: -------------------------------------------------------------------------------- 1 | # include nwrfcsdk 2 | /opt/sap/nwrfcsdk/lib -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .vscode 3 | infrastructure-tests/custom-environment.list 4 | infrastructure-tests/cx-server 5 | infrastructure-tests/jenkins-configuration/ 6 | infrastructure-tests/server.cfg 7 | *.DS_Store 8 | -------------------------------------------------------------------------------- /.github/workflows/reuse.yaml: -------------------------------------------------------------------------------- 1 | name: REUSE Compliance Check 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | test: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | - name: REUSE Compliance Check 11 | uses: fsfe/reuse-action@v1.1 12 | -------------------------------------------------------------------------------- /node-rfc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "abap_rfc_upload", 3 | "version": "0.0.1", 4 | "description": "This packge.json only describes the dependencies to be able to call node-rfc", 5 | "license": "UNLICENSED", 6 | "private": true, 7 | "devDependencies": { 8 | 9 | } 10 | } -------------------------------------------------------------------------------- /jacoco-cli/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest as builder 2 | RUN apk --no-cache add ca-certificates wget unzip 3 | RUN wget -O jacoco.zip http://search.maven.org/remotecontent?filepath=org/jacoco/jacoco/0.8.5/jacoco-0.8.5.zip && unzip jacoco.zip 4 | 5 | FROM openjdk:8-jre-slim 6 | 7 | COPY --from=builder lib/jacococli.jar / 8 | -------------------------------------------------------------------------------- /node-rfc/cts: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | 4 | $SAPBIN/node_modules/grunt-cli/bin/grunt --stack --no-color --gruntfile $SAPBIN/run_rfc_task.js "$@" 1>&2 5 | RC=$? 6 | 7 | # In case a transport request has been created this file provides the ID of 8 | # the transport request in a json format like {"REQUESTID":"ZZZK9NNNNN"} 9 | TRANSPORT_REQUEST_FILE="${SAPDATADIR}/CTS_Data.txt" 10 | TRACE_FILE=dev_rfc.trc 11 | 12 | if [ -f "${TRACE_FILE}" ] 13 | then 14 | cat "${TRACE_FILE}" 1>&2 15 | fi 16 | 17 | if [ -f "${TRANSPORT_REQUEST_FILE}" ] 18 | then 19 | cat "${TRANSPORT_REQUEST_FILE}" 20 | fi 21 | exit $RC 22 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image CI 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | 9 | build: 10 | 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Build the Docker image 16 | run: cd jacoco-cli; docker build . --file Dockerfile --tag ppiper/jacoco-cli:${GITHUB_REF##*/} 17 | - name: Push to Docker Hub 18 | run: | 19 | echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USER }} --password-stdin 20 | docker push ppiper/jacoco-cli:${GITHUB_REF##*/} 21 | rm -f /home/runner/.docker/config.json 22 | -------------------------------------------------------------------------------- /.github/workflows/push.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | 7 | build: 8 | 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v2 13 | - name: Build the Docker image 14 | run: cd jacoco-cli; docker build . --file Dockerfile --tag ppiper/jacoco-cli:latest 15 | - name: Push to Docker Hub (only on master branch) 16 | if: github.ref == 'refs/heads/master' 17 | run: | 18 | echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USER }} --password-stdin 19 | docker push ppiper/jacoco-cli:latest 20 | rm -f /home/runner/.docker/config.json 21 | -------------------------------------------------------------------------------- /node-rfc/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:slim 2 | 3 | USER root 4 | 5 | ARG NWRFC_FILE 6 | 7 | ENV DEBIAN_FRONTEND=noninteractive 8 | 9 | ENV SAPDIR=/opt/sap 10 | ENV SAPBIN=${SAPDIR}/bin 11 | ENV SAPDATADIR=/var/sap/data 12 | ENV PATH=${SAPBIN}:$PATH 13 | 14 | ADD $NWRFC_FILE /tmp/$NWRFC_FILE 15 | 16 | COPY nwrfcsdk.conf /etc/ld.so.conf.d/nwrfcsdk.conf 17 | COPY run_rfc_task.js ${SAPBIN}/run_rfc_task.js 18 | COPY package.json ${SAPBIN}/package.json 19 | COPY cts ${SAPBIN}/cts 20 | 21 | WORKDIR ${SAPBIN} 22 | 23 | RUN apt-get update && \ 24 | apt-get install -y apt-utils bzip2 unzip && \ 25 | rm -rf /var/lib/apt/lists/* /var/cache/apt/* && \ 26 | mkdir -p ${SAPDATADIR} && \ 27 | chown 1000:1000 ${SAPDATADIR} &&\ 28 | chmod a+x ${SAPBIN}/cts && \ 29 | cd ${SAPDIR} && \ 30 | unzip /tmp/$NWRFC_FILE && \ 31 | rm -f /tmp/$NWRFC_FILE && \ 32 | ldconfig -v && \ 33 | cd ${SAPBIN} && \ 34 | npm install grunt grunt-contrib-jshint grunt-cli node-rfc@next --save 35 | 36 | VOLUME $SAPDATADIR 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /jacoco-cli/README.md: -------------------------------------------------------------------------------- 1 | # JaCoCo CLI 2 | 3 | Utility image for running the JaCoCo CLI in containerized CI environments. 4 | It contains the openJDK JRE and `jacococli.jar`. 5 | 6 | # How to use this image 7 | 8 | Open a shell in the image and run `jacococli.jar` like: 9 | 10 | ``` 11 | $ docker run -it --rm ppiper/jacoco-cli 12 | # java -jar /jacococli.jar 13 | Command line interface for JaCoCo. 14 | 15 | Usage: java -jar jacococli.jar --help | 16 | : dump|instrument|merge|report|classinfo|execinfo|version 17 | --help : show help 18 | --quiet : suppress all output on stdout 19 | 20 | Argument "" is required 21 | ``` 22 | 23 | # How to build this image 24 | 25 | `docker build -t ppiper/jacoco-cli .` 26 | 27 | ## This image provides: 28 | 29 | - [JaCoCo CLI](https://www.jacoco.org/jacoco/trunk/doc/cli.html) 30 | 31 | ## License 32 | 33 | Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. 34 | This file is licensed under the Apache Software License, v. 2 except as noted 35 | otherwise in the [LICENSE file][license]. 36 | 37 | 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. 38 | 39 | [license]: https://github.com/SAP/devops-docker-images/blob/master/LICENSE 40 | 41 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Guidance on how to contribute 2 | 3 | There are two primary ways to help: 4 | * using the issue tracker, and 5 | * changing the code-base. 6 | 7 | ## Developer Certificate of Origin (DCO) 8 | 9 | Due to legal reasons, contributors will be asked to accept a DCO before they submit the first pull request to this projects, this happens in an automated fashion during the submission process. SAP uses [the standard DCO text of the Linux Foundation](https://developercertificate.org/). 10 | 11 | ## Using the issue tracker 12 | 13 | Use the issue tracker to suggest feature requests, report bugs, and ask 14 | questions. This is also a great way to connect with the developers of the 15 | project as well as others who are interested in this solution. 16 | 17 | Use the issue tracker to find ways to contribute. Find a bug or a feature, 18 | mention in the issue that you will take on that effort, then follow the 19 | guidance below. 20 | 21 | ## Changing the code-base 22 | 23 | Generally speaking, you should fork this repository, make changes in your own 24 | fork, and then submit a pull-request. All new code should have been thoroughly 25 | tested end-to-end in order to validate implemented features and the presence or 26 | lack of defects. All new scripts and docker files _must_ come with automated (unit) 27 | tests. 28 | 29 | The contract of functionality exposed by docker files functionality needs 30 | to be documented, so it can be properly used. Implementation of a functionality 31 | and its documentation shall happen within the same commit(s). 32 | 33 | #### Consistent USER Instruction in the Dockerfile 34 | 35 | Set the user name (or UID) and the user group (or GID) to UID 1000 and GID 1000 to be consistent ith the Jenkins image. 36 | 37 | ```` 38 | USER 1000:1000 39 | ```` 40 | -------------------------------------------------------------------------------- /.reuse/dep5: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: github.com/SAP/devops-docker-images 3 | Upstream-Contact: thorsten.duda_AT_sap.com 4 | Source: https://github.com/SAP/devops-docker-images 5 | Disclaimer: The code in this project may include calls to APIs (“API Calls”) of 6 | SAP or third-party products or services developed outside of this project 7 | (“External Products”). 8 | “APIs” means application programming interfaces, as well as their respective 9 | specifications and implementing code that allows software to communicate with 10 | other software. 11 | API Calls to External Products are not licensed under the open source license 12 | that governs this project. The use of such API Calls and related External 13 | Products are subject to applicable additional agreements with the relevant 14 | provider of the External Products. In no event shall the open source license 15 | that governs this project grant any rights in or to any External Products,or 16 | alter, expand or supersede any terms of the applicable additional agreements. 17 | If you have a valid license agreement with SAP for the use of a particular SAP 18 | External Product, then you may make use of any API Calls included in this 19 | project’s code for that SAP External Product, subject to the terms of such 20 | license agreement. If you do not have a valid license agreement for the use of 21 | a particular SAP External Product, then you may only make use of any API Calls 22 | in this project for that SAP External Product for your internal, non-productive 23 | and non-commercial test and evaluation of such API Calls. Nothing herein grants 24 | you any rights to use or access any SAP External Product, or provide any third 25 | parties the right to use of access any SAP External Product, through API Calls. 26 | Please note that Docker images can contain other software which may be licensed under different licenses. 27 | For any usage of built Docker images please make sure to check the licenses of the artifacts contained in the images. 28 | 29 | Files: ** 30 | Copyright: 2017-2020 SAP SE or an SAP affiliate company and contributors 31 | License: Apache-2.0 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![REUSE status](https://api.reuse.software/badge/github.com/SAP/devops-docker-images)](https://api.reuse.software/info/github.com/SAP/devops-docker-images) 2 | 3 | ## Description 4 | 5 | This is a collection of [_Dockerfiles_](https://docs.docker.com/engine/reference/builder/) for images that can be used in _Continuous Delivery_ (CD) pipelines 6 | for SAP development projects. The images are optimized for use with project ["Piper"](https://github.com/SAP/jenkins-library) on [Jenkins](https://jenkins.io/). Docker containers simplify your CD tool setup, encapsulating 7 | tools and environments that are required to execute pipeline steps. 8 | 9 | If you want to learn how to use project "Piper" please have a look at [the documentation](https://github.com/SAP/jenkins-library/blob/master/README.md). Introductory material and a lot of SAP scenarios not covered by project "Piper" are described in our [Continuous Integration Best Practices](https://developers.sap.com/tutorials/ci-best-practices-intro.html). 10 | 11 | **Note:** This repository has been split up. 12 | Please refer to the following repositories for current Dockerfiles and documentation: 13 | 14 | * [CF cli](https://github.com/SAP/devops-docker-cf-cli) 15 | * [Neo cli](https://github.com/SAP/devops-docker-neo-cli) 16 | * [Cloud MTA Builder](https://sap.github.io/cloud-mta-build-tool) 17 | * [Node browsers](https://github.com/SAP/devops-docker-node-browsers) 18 | 19 | ### Docker Images 20 | 21 | The following images are published on [hub.docker.com](https://hub.docker.com/search?q=ppiper&type=image): 22 | 23 | | Name | Description | Docker Image | 24 | |------|-------------|------| 25 | | Cloud MTA Build Tool | Build multitarget applications with the [Cloud MTA Build Tool](https://sap.github.io/cloud-mta-build-tool/). | [devxci/mbtci](https://hub.docker.com/r/devxci/mbtci) | 26 | | CM Client | Interact with SAP Solution Manager or CTS using the command line. | [ppiper/cm-client](https://hub.docker.com/r/ppiper/cm-client) | 27 | | CloudFoundry CLI | Use command line tools for Cloud Foundry with plugins for blue-green deployment and MTA. | [ppiper/cf-cli](https://hub.docker.com/r/ppiper/cf-cli) | 28 | | Neo CLI | Use SAP Cloud Platform tools for Neo. | [neo-cli/](https://hub.docker.com/r/ppiper/neo-cli/) | 29 | | Jenkinsfile Runner| Run a `Jenkinsfile` without a long-running, stateful Jenkins master. The [Jenkinsfile Runner](https://github.com/jenkinsci/jenkinsfile-runner) is based on `ppiper/jenkins-master`. | [ppiper/jenkinsfile-runner](https://hub.docker.com/r/ppiper/jenkinsfile-runner) | 30 | | Node Browsers | Use web browsers for end-to-end tests of web applications in Jenkins pipelines. | [node-browsers/](https://hub.docker.com/r/ppiper/node-browsers/) | 31 | | SAP HANA XS Advanced CLI | Use command line tools to deploy to SAP HANA XS Advanced. | [Dockerfile](https://github.com/SAP/devops-docker-xsa-cli/) | 32 | 33 | ## How to obtain support 34 | 35 | Feel free to open new issues for feature requests, bugs or general feedback on 36 | the [GitHub issues page of this project][devops-docker-images-issues]. 37 | 38 | ## Contributing 39 | 40 | Read and understand our [contribution guidelines][contribution] 41 | before opening a pull request. 42 | 43 | [devops-docker-images-issues]: https://github.com/SAP/devops-docker-images/issues 44 | [contribution]: https://github.com/SAP/devops-docker-images/blob/master/CONTRIBUTING.md 45 | -------------------------------------------------------------------------------- /node-rfc/README.md: -------------------------------------------------------------------------------- 1 | # RFC CTS+ Docker File 2 | 3 | ## Description 4 | 5 | To bring an SAP UI5 application to an ABAP-Frontend-Server you need to create a transport request and upload the application. The application can be uploaded using the docker image as defined by the script provided here. 6 | 7 | Setting up the RFC communication is tedious and clutters the build server. Detailed instructions can be found in the [CI Best Practices Guide][bestpractice]. 8 | This Dockerfile provides a simpler and cleaner way to run the node-rfc wrapper and the SAP NetWeaver RFC Library. The only thing you need to have is a Docker environment to build and to execute the node-rfc wrapper image. The image can be used stand-alone in a custom Continuous Delivery environment or you can use it within our Jenkins library [project "Piper"][piper]. 9 | 10 | ## Requirements 11 | 12 | * General requirements can be found in the [repository readme][general] 13 | * An S-User for [SAP ONE][sapone] 14 | * Download NWRFC library ```SAP NW RFC SDK 7.50``` for Linux on x86_64 from [SAP ONE][sapone] 15 | 16 | ## How to build it 17 | 18 | This image will not be provided on hub.docker.com. You need to [build][dockerbuild] this Dockerfile locally before using it. 19 | 20 | ### Build Arguments 21 | | Argument | Description | 22 | | ---------| ------------| 23 | | **NWRFC_FILE** | Path to your NWRFC zip file | 24 | 25 | The build arguments can be a local path or an URL. Please consider the rules for the build context and the used [ADD][dockerbuildadd] command. 26 | 27 | The following example assumes the NWRFC library is accessible via HTTP: 28 | ``` 29 | docker build -t ppiper/node-rfc --build-arg NWRFC_FILE=https:///nwrcf.zip --file Dockerfile https://github.com/SAP/devops-docker-images.git#:node-rfc 30 | ``` 31 | 32 | ## How to execute it 33 | 34 | ### Environment Variables 35 | | Variable | Description | 36 | | -------- | ----------- | 37 | | **ABAP_DEVELOPMENT_USER** | ABAP user to access RFC | 38 | | **ABAP_DEVELOPMENT_PASSWORD** | ABAP user password | 39 | | **ABAP_DEVELOPMENT_SERVER** | Application server URL | 40 | | **ABAP_DEVELOPMENT_INSTANCE** | ABAP instance ID | 41 | | **ABAP_DEVELOPMENT_CLIENT** | ABAP client ID | 42 | | **ABAP_APPLICATION_NAME** | ABAP application name | 43 | | **ABAP_APPLICATION_DESC** | ABAP application description | 44 | | **ABAP_PACKAGE** | ABAP package name | 45 | | **ZIP_FILE_URL** | URL of the UI5 zip file location to upload | 46 | | **CODE_PAGE** | Code page like UTF8 | 47 | | **ABAP_ACCEPT_UNIX_STYLE_EOL** | true: 'X' or 'Yes' or '1', false: '-' | 48 | | **TRANSPORT_DESCRIPTION** | Transport description text | 49 | 50 | Assuming you have built the image with using the tag `ppiper/node-rfc` you can run it with: 51 | 52 | ``` 53 | docker run --env ppiper/node-rfc cts createTransportRequest|uploadToABAP|releaseTransport 54 | ``` 55 | 56 | [piper]: https://sap.github.io/jenkins-library/ 57 | [noderfc]: https://sap.github.io/node-rfc/install.html 58 | [sapone]: https://launchpad.support.sap.com/ 59 | [bestpractice]: https://developers.sap.com/tutorials/ci-best-practices-fiori-abap.html 60 | [general]: https://github.com/SAP/devops-docker-images/blob/master/README.md 61 | [dockerbuild]: https://docs.docker.com/engine/reference/commandline/build/ 62 | [dockerbuildadd]: https://docs.docker.com/engine/reference/builder/#add 63 | [dockerrun]: https://docs.docker.com/engine/reference/run/ 64 | [cmclient]: https://github.com/SAP/devops-cm-client 65 | -------------------------------------------------------------------------------- /node-rfc/run_rfc_task.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var rfc = require("node-rfc"); 4 | var fs = require("fs"); 5 | var util = require('util'); 6 | 7 | module.exports = function(grunt) { 8 | 9 | // Project specific variables 10 | var abapDevelopmentUser = process.env.ABAP_DEVELOPMENT_USER; 11 | var abapDevelopmentPassword = process.env.ABAP_DEVELOPMENT_PASSWORD; 12 | var abapDevelopmentServer = process.env.ABAP_DEVELOPMENT_SERVER; 13 | var abapDevelopmentInstance = process.env.ABAP_DEVELOPMENT_INSTANCE; 14 | var abapDevelopmentClient = process.env.ABAP_DEVELOPMENT_CLIENT; 15 | var abapApplicationName = process.env.ABAP_APPLICATION_NAME; 16 | var abapApplicationDesc = process.env.ABAP_APPLICATION_DESC; 17 | var abapPackage = process.env.ABAP_PACKAGE; 18 | var zipFileURL = process.env.ZIP_FILE_URL; 19 | var codePage = process.env.CODE_PAGE; 20 | var acceptUnixStyleLineEndings = process.env.ABAP_ACCEPT_UNIX_STYLE_EOL; 21 | var transportDescription = process.env.TRANSPORT_DESCRIPTION; 22 | var targetDir = process.env.SAPDATADIR; 23 | var testMode = process.env.TEST_MODE 24 | var verbose = process.env.VERBOSE; 25 | var failUploadOnWarning = process.env.FAIL_UPLOAD_ON_WARNING; 26 | 27 | 28 | // Global Variables 29 | var ctsDataFile = targetDir + "/CTS_Data.txt"; 30 | 31 | // Project configuration. 32 | var abapConn = { 33 | user: abapDevelopmentUser, 34 | passwd: abapDevelopmentPassword, 35 | ashost: abapDevelopmentServer, 36 | sysnr: abapDevelopmentInstance, 37 | client: abapDevelopmentClient 38 | }; 39 | grunt.initConfig({ 40 | pkg: grunt.file.readJSON("package.json"), 41 | createTransportRequest: { 42 | options: { 43 | conn: abapConn, 44 | author: abapDevelopmentUser, 45 | description: transportDescription, 46 | verbose: verbose 47 | } 48 | }, 49 | uploadToABAP: { 50 | options: { 51 | conn: abapConn, 52 | zipFileURL: zipFileURL, 53 | codePage: codePage, 54 | acceptUnixStyleLineEndings: acceptUnixStyleLineEndings, 55 | testMode: testMode, 56 | verbose: verbose, 57 | failUploadOnWarning: failUploadOnWarning 58 | } 59 | }, 60 | releaseTransport: { 61 | options: { 62 | conn: abapConn, 63 | verbose: verbose 64 | } 65 | } 66 | }); 67 | 68 | var rfcConnect = function(functionModule, importParameters, gruntContext) { 69 | return new Promise(function(resolve, reject) { 70 | var verbose = gruntContext.options().verbose 71 | var conn = gruntContext.options().conn; 72 | var client = new rfc.Client(conn); 73 | 74 | grunt.log.writeln("RFC client lib version:", client.version); 75 | 76 | client.connect(function(err) { 77 | if (err) { // check for login/connection errors 78 | grunt.log.errorlns("could not connect to server", err); 79 | return reject(); 80 | } 81 | // invoke remote enabled ABAP function module 82 | grunt.log.writeln("Invoking function module", functionModule); 83 | client.invoke(functionModule, 84 | importParameters, 85 | function(err, res) { 86 | if (err) { // check for errors (e.g. wrong parameters) 87 | grunt.log.errorlns("Error invoking", functionModule, err); 88 | return reject(); 89 | } 90 | client.close(); 91 | if(verbose == 'true') { 92 | grunt.log.writeln("Result:", res); 93 | } 94 | return resolve(res); 95 | }); 96 | }); 97 | }); 98 | }; 99 | 100 | 101 | grunt.registerTask("createTransportRequest", "Creates an ABAP Transport Request", function() { 102 | grunt.log.writeln("Creating Transport Request"); 103 | var importParameters = { 104 | AUTHOR: this.options().author, 105 | TEXT: this.options().description 106 | }; 107 | var done = this.async(); 108 | rfcConnect("BAPI_CTREQUEST_CREATE", importParameters, this) 109 | .then( 110 | function(returnValue) { 111 | if (returnValue.RETURN.TYPE == "E" || returnValue.RETURN.TYPE == "W") { 112 | grunt.log.errorlns("Error invoking BAPI_CTREQUEST_CREATE."); 113 | grunt.log.writeln("Return:", returnValue); 114 | done(false); 115 | return; 116 | } 117 | if (returnValue.REQUESTID == "") { 118 | grunt.log.errorlns("Error invoking BAPI_CTREQUEST_CREATE."); 119 | grunt.log.errorlns("Transport request could not be created."); 120 | grunt.log.errorlns(returnValue.RETURN.MESSAGE); 121 | done(false); 122 | return; 123 | } 124 | grunt.log.writeln("Transport request", returnValue.REQUESTID, "created."); 125 | if (fs.existsSync(targetDir) === false) { 126 | fs.mkdirSync(targetDir); 127 | } 128 | fs.writeFile(ctsDataFile, 129 | JSON.stringify( 130 | { REQUESTID: returnValue.REQUESTID } 131 | ), 132 | function(err) { 133 | if (err) { 134 | grunt.log.errorlns("Error Creating file:", err); 135 | done(false); 136 | return; 137 | } 138 | grunt.log.writeln("Created file:", ctsDataFile); 139 | done(); 140 | } 141 | ) 142 | }, 143 | function() { 144 | done(false); 145 | }); 146 | }); 147 | 148 | grunt.registerTask("uploadToABAP", "Uploads the application to the ABAP System", function(transportRequest) { 149 | util.inspect.defaultOptions.maxArrayLength = null; 150 | grunt.log.writeln("Uploading to ABAP"); 151 | if (!transportRequest) { 152 | grunt.log.errorlns("No Transport request specified."); 153 | return (false); 154 | } 155 | grunt.log.writeln("Transport request:", transportRequest); 156 | var url = this.options().zipFileURL; 157 | var verbose = this.options().verbose; 158 | var failUploadOnWarning = this.options().failUploadOnWarning; 159 | var testMode = this.options().testMode; 160 | if ( !testMode ) testMode = "-"; 161 | var importParameters = { 162 | IV_URL: url, 163 | IV_SAPUI5_APPLICATION_NAME: abapApplicationName, 164 | IV_SAPUI5_APPLICATION_DESC: abapApplicationDesc, 165 | IV_PACKAGE: abapPackage, 166 | IV_WORKBENCH_REQUEST: transportRequest, 167 | IV_TEST_MODE: testMode, 168 | IV_EXTERNAL_CODE_PAGE: this.options().codePage, 169 | IV_ACCEPT_UNIX_STYLE_EOL: this.options().acceptUnixStyleLineEndings 170 | }; 171 | var done = this.async(); 172 | grunt.log.writeln("Uploading application from", url); 173 | rfcConnect("/UI5/UI5_REPOSITORY_LOAD_HTTP", importParameters, this) 174 | .then( 175 | function(returnValue) { 176 | if (returnValue.EV_SUCCESS == "E" || (failUploadOnWarning != "false" && returnValue.EV_SUCCESS == "W")) { 177 | grunt.log.errorlns("Error invoking", "/UI5/UI5_REPOSITORY_LOAD_HTTP"); 178 | grunt.log.writeln("Return:", returnValue); 179 | done(false); 180 | return; 181 | } else if (returnValue.EV_SUCCESS == 'S') { 182 | grunt.log.writeln("Application uploaded."); 183 | done(); 184 | } else { 185 | grunt.log.writeln("Invalid return status (EV_SUCCESS): " + returnValue.EV_SUCCESS); 186 | done(false); 187 | return; 188 | } 189 | if(verbose == 'true' ) { 190 | grunt.log.writeln("Return:", returnValue); 191 | } 192 | 193 | grunt.log.writeln("Application uploaded."); 194 | done(); 195 | 196 | }, 197 | function() { 198 | done(false); 199 | }); 200 | }); 201 | 202 | grunt.registerTask("releaseTransport", "Releases an ABAP Transport Request", function(transportRequest) { 203 | grunt.log.writeln("Releasing Transport Request"); 204 | if (!transportRequest) { 205 | grunt.log.errorlns("No Transport request specified."); 206 | return (false); 207 | } 208 | grunt.log.writeln("Transport request:", transportRequest); 209 | var importParameters = { 210 | REQUESTID: transportRequest, 211 | COMPLETE: "X", 212 | BATCH_MODE: "X" 213 | } 214 | var done = this.async(); 215 | rfcConnect("BAPI_CTREQUEST_RELEASE", importParameters, this) 216 | .then( 217 | function(returnValue) { 218 | if (returnValue.RETURN.TYPE == "E" || returnValue.RETURN.TYPE == "W") { 219 | grunt.log.errorlns("Error invoking", "BAPI_CTREQUEST_RELEASE"); 220 | grunt.log.writeln("Return:", returnValue); 221 | 222 | done(false); 223 | return; 224 | } 225 | grunt.log.writeln("Transport request released."); 226 | done(); 227 | }, 228 | function() { 229 | done(false); 230 | }); 231 | }); 232 | }; 233 | -------------------------------------------------------------------------------- /LICENSES/Apache-2.0.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | 3 | Version 2.0, January 2004 4 | 5 | http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, 6 | AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | 11 | 12 | "License" shall mean the terms and conditions for use, reproduction, and distribution 13 | as defined by Sections 1 through 9 of this document. 14 | 15 | 16 | 17 | "Licensor" shall mean the copyright owner or entity authorized by the copyright 18 | owner that is granting the License. 19 | 20 | 21 | 22 | "Legal Entity" shall mean the union of the acting entity and all other entities 23 | that control, are controlled by, or are under common control with that entity. 24 | For the purposes of this definition, "control" means (i) the power, direct 25 | or indirect, to cause the direction or management of such entity, whether 26 | by contract or otherwise, or (ii) ownership of fifty percent (50%) or more 27 | of the outstanding shares, or (iii) beneficial ownership of such entity. 28 | 29 | 30 | 31 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions 32 | granted by this License. 33 | 34 | 35 | 36 | "Source" form shall mean the preferred form for making modifications, including 37 | but not limited to software source code, documentation source, and configuration 38 | files. 39 | 40 | 41 | 42 | "Object" form shall mean any form resulting from mechanical transformation 43 | or translation of a Source form, including but not limited to compiled object 44 | code, generated documentation, and conversions to other media types. 45 | 46 | 47 | 48 | "Work" shall mean the work of authorship, whether in Source or Object form, 49 | made available under the License, as indicated by a copyright notice that 50 | is included in or attached to the work (an example is provided in the Appendix 51 | below). 52 | 53 | 54 | 55 | "Derivative Works" shall mean any work, whether in Source or Object form, 56 | that is based on (or derived from) the Work and for which the editorial revisions, 57 | annotations, elaborations, or other modifications represent, as a whole, an 58 | original work of authorship. For the purposes of this License, Derivative 59 | Works shall not include works that remain separable from, or merely link (or 60 | bind by name) to the interfaces of, the Work and Derivative Works thereof. 61 | 62 | 63 | 64 | "Contribution" shall mean any work of authorship, including the original version 65 | of the Work and any modifications or additions to that Work or Derivative 66 | Works thereof, that is intentionally submitted to Licensor for inclusion in 67 | the Work by the copyright owner or by an individual or Legal Entity authorized 68 | to submit on behalf of the copyright owner. For the purposes of this definition, 69 | "submitted" means any form of electronic, verbal, or written communication 70 | sent to the Licensor or its representatives, including but not limited to 71 | communication on electronic mailing lists, source code control systems, and 72 | issue tracking systems that are managed by, or on behalf of, the Licensor 73 | for the purpose of discussing and improving the Work, but excluding communication 74 | that is conspicuously marked or otherwise designated in writing by the copyright 75 | owner as "Not a Contribution." 76 | 77 | 78 | 79 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf 80 | of whom a Contribution has been received by Licensor and subsequently incorporated 81 | within the Work. 82 | 83 | 2. Grant of Copyright License. Subject to the terms and conditions of this 84 | License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, 85 | no-charge, royalty-free, irrevocable copyright license to reproduce, prepare 86 | Derivative Works of, publicly display, publicly perform, sublicense, and distribute 87 | the Work and such Derivative Works in Source or Object form. 88 | 89 | 3. Grant of Patent License. Subject to the terms and conditions of this License, 90 | each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, 91 | no-charge, royalty-free, irrevocable (except as stated in this section) patent 92 | license to make, have made, use, offer to sell, sell, import, and otherwise 93 | transfer the Work, where such license applies only to those patent claims 94 | licensable by such Contributor that are necessarily infringed by their Contribution(s) 95 | alone or by combination of their Contribution(s) with the Work to which such 96 | Contribution(s) was submitted. If You institute patent litigation against 97 | any entity (including a cross-claim or counterclaim in a lawsuit) alleging 98 | that the Work or a Contribution incorporated within the Work constitutes direct 99 | or contributory patent infringement, then any patent licenses granted to You 100 | under this License for that Work shall terminate as of the date such litigation 101 | is filed. 102 | 103 | 4. Redistribution. You may reproduce and distribute copies of the Work or 104 | Derivative Works thereof in any medium, with or without modifications, and 105 | in Source or Object form, provided that You meet the following conditions: 106 | 107 | (a) You must give any other recipients of the Work or Derivative Works a copy 108 | of this License; and 109 | 110 | (b) You must cause any modified files to carry prominent notices stating that 111 | You changed the files; and 112 | 113 | (c) You must retain, in the Source form of any Derivative Works that You distribute, 114 | all copyright, patent, trademark, and attribution notices from the Source 115 | form of the Work, excluding those notices that do not pertain to any part 116 | of the Derivative Works; and 117 | 118 | (d) If the Work includes a "NOTICE" text file as part of its distribution, 119 | then any Derivative Works that You distribute must include a readable copy 120 | of the attribution notices contained within such NOTICE file, excluding those 121 | notices that do not pertain to any part of the Derivative Works, in at least 122 | one of the following places: within a NOTICE text file distributed as part 123 | of the Derivative Works; within the Source form or documentation, if provided 124 | along with the Derivative Works; or, within a display generated by the Derivative 125 | Works, if and wherever such third-party notices normally appear. The contents 126 | of the NOTICE file are for informational purposes only and do not modify the 127 | License. You may add Your own attribution notices within Derivative Works 128 | that You distribute, alongside or as an addendum to the NOTICE text from the 129 | Work, provided that such additional attribution notices cannot be construed 130 | as modifying the License. 131 | 132 | You may add Your own copyright statement to Your modifications and may provide 133 | additional or different license terms and conditions for use, reproduction, 134 | or distribution of Your modifications, or for any such Derivative Works as 135 | a whole, provided Your use, reproduction, and distribution of the Work otherwise 136 | complies with the conditions stated in this License. 137 | 138 | 5. Submission of Contributions. Unless You explicitly state otherwise, any 139 | Contribution intentionally submitted for inclusion in the Work by You to the 140 | Licensor shall be under the terms and conditions of this License, without 141 | any additional terms or conditions. Notwithstanding the above, nothing herein 142 | shall supersede or modify the terms of any separate license agreement you 143 | may have executed with Licensor regarding such Contributions. 144 | 145 | 6. Trademarks. This License does not grant permission to use the trade names, 146 | trademarks, service marks, or product names of the Licensor, except as required 147 | for reasonable and customary use in describing the origin of the Work and 148 | reproducing the content of the NOTICE file. 149 | 150 | 7. Disclaimer of Warranty. Unless required by applicable law or agreed to 151 | in writing, Licensor provides the Work (and each Contributor provides its 152 | Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 153 | KIND, either express or implied, including, without limitation, any warranties 154 | or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR 155 | A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness 156 | of using or redistributing the Work and assume any risks associated with Your 157 | exercise of permissions under this License. 158 | 159 | 8. Limitation of Liability. In no event and under no legal theory, whether 160 | in tort (including negligence), contract, or otherwise, unless required by 161 | applicable law (such as deliberate and grossly negligent acts) or agreed to 162 | in writing, shall any Contributor be liable to You for damages, including 163 | any direct, indirect, special, incidental, or consequential damages of any 164 | character arising as a result of this License or out of the use or inability 165 | to use the Work (including but not limited to damages for loss of goodwill, 166 | work stoppage, computer failure or malfunction, or any and all other commercial 167 | damages or losses), even if such Contributor has been advised of the possibility 168 | of such damages. 169 | 170 | 9. Accepting Warranty or Additional Liability. While redistributing the Work 171 | or Derivative Works thereof, You may choose to offer, and charge a fee for, 172 | acceptance of support, warranty, indemnity, or other liability obligations 173 | and/or rights consistent with this License. However, in accepting such obligations, 174 | You may act only on Your own behalf and on Your sole responsibility, not on 175 | behalf of any other Contributor, and only if You agree to indemnify, defend, 176 | and hold each Contributor harmless for any liability incurred by, or claims 177 | asserted against, such Contributor by reason of your accepting any such warranty 178 | or additional liability. END OF TERMS AND CONDITIONS 179 | 180 | APPENDIX: How to apply the Apache License to your work. 181 | 182 | To apply the Apache License to your work, attach the following boilerplate 183 | notice, with the fields enclosed by brackets "[]" replaced with your own identifying 184 | information. (Don't include the brackets!) The text should be enclosed in 185 | the appropriate comment syntax for the file format. We also recommend that 186 | a file or class name and description of purpose be included on the same "printed 187 | page" as the copyright notice for easier identification within third-party 188 | archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | 194 | you may not use this file except in compliance with the License. 195 | 196 | You may obtain a copy of the License at 197 | 198 | http://www.apache.org/licenses/LICENSE-2.0 199 | 200 | Unless required by applicable law or agreed to in writing, software 201 | 202 | distributed under the License is distributed on an "AS IS" BASIS, 203 | 204 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 205 | 206 | See the License for the specific language governing permissions and 207 | 208 | limitations under the License. 209 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2017-2021 SAP SE or an SAP affiliate company and contributors 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------