-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile-upload-app-package.js
37 lines (31 loc) · 1.26 KB
/
gulpfile-upload-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
'use strict';
const gulp = require('gulp');
const build = require('@microsoft/sp-build-web');
const spsync = require('gulp-spsync-creds').sync;
const environmentInfo = {
"username": "[email protected]",
"password": "pass#123",
"tenant": "postennorgeorg",
"catalogSite": "sites/Apps/"
}
build.task('upload-app-pkg', {
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;
return new Promise((resolve, reject) => {
const pkgFile = require('./config/package-solution.json');
const folderLocation = `./sharepoint/${pkgFile.paths.zippedPackage}`;
return gulp.src(folderLocation)
.pipe(spsync({
"username": environmentInfo.username,
"password": environmentInfo.password,
"site": `https://${environmentInfo.tenant}.sharepoint.com/${environmentInfo.catalogSite}`,
"libraryPath": "AppCatalog",
"publish": true
}))
.on('finish', resolve);
});
}
});