Gulp task to publish local files to a ServiceNow instance. Useful if you want to code locally, and/or use Babel/bublé/etc.
const gulp = require('gulp');
const snPublish = require('gulp-sn-publish');
const snConfig = {
url: 'https://your-service-now-instance.com',
api: '/api/now/table',
user: 'username',
password: 'user password',
files: [
{
path: 'index.js',
table: 'sys_script_include',
field: 'script',
id: 'f08ea6fddb91e600a18e73ffbf96193a',
},
]
};
gulp.task('publish', function () {
return gulp.src('index.js')
.pipe(snPublish(snConfig));
});
gulp.task('default', ['publish']);
Tests