Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-sapui5-gitlab-deploy

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-sapui5-gitlab-deploy - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

5

package.json
{
"name": "grunt-sapui5-gitlab-deploy",
"version": "1.0.3",
"version": "1.0.4",
"description": "Deploy UI5 resources to ABAP system directly from Gitlab",

@@ -22,4 +22,5 @@ "main": "index.js",

"gitlab": "^4.2.1",
"node-fetch": "^2.2.0"
"node-fetch": "^2.2.0",
"xml-js": "^1.6.8"
}
}

39

tasks/deploy.js
// fetch polyfill
const nodeFetch = require("node-fetch");
// cookie decorator
// cookie decorator
const fetch = require("fetch-cookie")(nodeFetch);

@@ -8,8 +8,9 @@ // Gitlab API client

const convert = require("xml-js");
module.exports = function(grunt) {
"use strict";
// deploy from gitlab to ABAP
grunt.registerTask("gitlab_deploy", async function() {
// must be async

@@ -19,3 +20,2 @@ let done = this.async();

try {
// Instantiating the API

@@ -45,3 +45,5 @@ const api = new Gitlab({

// deploy to ABAP ( sending artifact URL to a backend )
await deployToABAP(sUrl);
let oResponse = await deployToABAP(sUrl);
let sResponseXML = await oResponse.text();
printOdataResponse(sResponseXML);
} catch (error) {

@@ -54,2 +56,29 @@ grunt.log.error(error);

function printOdataResponse(sResponseXML) {
let oReply = Object.assign(
{
error: {
message: {},
innererror: { errordetails: { errordetail: [] } }
}
},
convert.xml2js(sResponseXML, { compact: true })
);
oReply.error.innererror.errordetails.errordetail.forEach(oError => {
let sMessage = oError.message._text;
switch (oError.severity._text) {
case "error":
grunt.log.error(sMessage);
break;
default:
grunt.log.writeln(sMessage);
break;
}
});
if (oReply.error.message._text) {
grunt.fail.fatal(oReply.error.message._text);
}
}
async function deployToABAP(sUrl) {

@@ -56,0 +85,0 @@ const base_auth = "Basic " + process.env.ABAP_BASIC_TOKEN;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc