Skip to content

mhazebroucq/gulp-sharepoint-local-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

v1.2 - Maxime
Fork from https://github.com/jeffangama/gulpsynchLocalToRemote

Objective :

Work on SharePoint 2013 files in VSCode.
Using gulp task you can download, upload and watch files.

Contents

Installation

Step 0

Create a folder to store your solution.

Step 1

Install gulp-sharepoint-local-sync npm package

npm i gulp-sharepoint-local-sync

Step 2

Open et update config.js file.
This file allow you to define many profiles and select the one you want to activate by exporting the wanted config name.

module.exports = {
    dev: {        
        "site": "http://test-site-url", // full ulr of the SharePoint on-premises site
        "skipInstall": false,
        "verbose": "false",
        "config":"Dev",
        "remoteFoldersToGet":["SiteAssets","_catalogs/masterpage"],// folders for which you want to retrieve content in the populate task
        "location":"src"// location where files will be downloaded, uploaded and watched
    },
    preprod: {        
        "site": "http://preprod-site-url", // full ulr of the SharePoint on-premises site
        "skipInstall": false,
        "verbose": "false",
        "config":"Preprod",
        "remoteFoldersToGet":["SiteAssets","_catalogs/masterpage"],// folders for which you want to retrieve content in the populate task
        "location":"src"// location where files will be downloaded, uploaded and watched
    },
    prod: {        
        "site": "http://prod-site-url", // full ulr of the SharePoint on-premises site
        "skipInstall": false,
        "verbose": "false",
        "config":"Prod",
        "remoteFoldersToGet":["SiteAssets","_catalogs/masterpage"],  // folders for which you want to retrieve content in the populate task
        "location":"src" // location where files will be downloaded, uploaded and watched
    }
}.dev;

Step 3

Create a creds.js file in the parent folder.
This file is outside of the solution folder to avoid to upload it to git.

module.exports = {
    dev: {        
    "username": "user@domain.com",
    "password": "password"
    }
}.dev;

Usage

  • A) Push the files to SharePoint immediately. It will need a confirm and then it will create the folder by it self.
    Only the updated files since last push will be pushed. If it is the first push, all files will be pushed.
gulp 
  • B) Watch changes and push immediately each file you update
gulp watch
  • C) Publish all files to SharePoint regardless of the modification dates
gulp publish-all
  • D) If you want to retrieve all items from the folders defined in "remoteFoldersToGet" :
gulp populate

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published