-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile-deploy-app-package.js
41 lines (37 loc) · 1.56 KB
/
gulpfile-deploy-app-package.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'use strict';
const build = require('@microsoft/sp-build-web');
const sppkgDeploy = require('node-sppkg-deploy');
const environmentInfo = {
"username": "[email protected]",
"password": "pass#123",
"tenant": "postennorgeorg",
"catalogSite": "sites/Apps/"
};
build.task('deploy-sppkg', {
execute: (config) => {
environmentInfo.username = config.args['username'] || environmentInfo.username;
environmentInfo.password = config.args['password'] || environmentInfo.password;
environmentInfo.tenant = config.args['tenant'] || environmentInfo.tenant;
environmentInfo.catalogSite = config.args['catalogsite'] || environmentInfo.catalogSite;
const pkgFile = require('./config/package-solution.json');
if (pkgFile) {
// Retrieve the filename from the package solution config file
let filename = pkgFile.paths.zippedPackage;
console.log(filename);
// Remove the solution path from the filename
filename = filename.split('/').pop();
// Retrieve the skip feature deployment setting from the package solution config file
const skipFeatureDeployment = pkgFile.solution.skipFeatureDeployment ? pkgFile.solution.skipFeatureDeployment : false;
// Deploy the SharePoint package
return sppkgDeploy.deploy({
username: environmentInfo.username,
password: environmentInfo.password,
tenant: environmentInfo.tenant,
site: environmentInfo.catalogSite,
filename: filename,
skipFeatureDeployment: skipFeatureDeployment,
verbose: true
});
}
}
});