-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.min.js
1 lines (1 loc) · 1.67 KB
/
gulpfile.min.js
1
"use strict";const gulp=require("gulp"),build=require("@microsoft/sp-build-web"),spsync=require("gulp-spsync-creds").sync,production={username:"[email protected]",password:"pass#123",tenant:"postennorgeorg",cdnSite:"/sites/MyLinkV1",cdnLib:"/sites/MyLinkV1/CDN/",catalogSite:"/sites/Apps/AppCatalog"},test={username:"[email protected]",password:"pass#123",tenant:"postennorgeorg",cdnSite:"/sites/MyLinkV1/",cdnLib:"SITES/MYLINKV1/CDN",catalogSite:"/sites/Apps/AppCatalog"};build.task("upload-to-sharepoint",{execute:config=>new Promise((resolve,reject)=>{const deployFolder=require("./config/copy-assets.json"),folderLocation=`./${deployFolder.deployCdnPath}/**/*.js`;return gulp.src(folderLocation).pipe(spsync({username:config.production?production.username:test.username,password:config.production?production.password:test.password,site:`https://${config.production?production.tenant:test.tenant}.sharepoint.com/${config.production?production.cdnSite:test.cdnSite}`,libraryPath:config.production?production.cdnLib:test.cdnLib,publish:!0})).on("finish",resolve)})}),build.task("upload-app-pkg",{execute:config=>new Promise((resolve,reject)=>{const pkgFile=require("./config/package-solution.json"),folderLocation=`./sharepoint/${pkgFile.paths.zippedPackage}`;return gulp.src(folderLocation).pipe(spsync({username:config.production?production.username:test.username,password:config.production?production.password:test.password,site:`https://${config.production?production.tenant:test.tenant}.sharepoint.com/${config.production?production.catalogSite:test.catalogSite}`,libraryPath:"AppCatalog",publish:!0})).on("finish",resolve)})}),build.initialize(gulp);