Utility for publishing free-range applications and libraries to our CDN using Gulp.
Install gulp-frau-publisher
as a dependency:
npm install --save-dev gulp-frau-publisher
To publish a free-range application:
var publisher = require('gulp-frau-publisher');
var options = {
id: 'someID',
creds: {
"key": "AKITHISISSOMEKEYASDF",
"secret": "aCD233rDF232RANDOMSECRET12+32g"
},
devTag: '4.2.0'
};
var appPublisher = publisher.app( options );
gulp.src('./dist/**')
.pipe( appPublisher.getStream() );
Alternately, to publish a library (e.g. jQuery, Angular, etc.) to the CDN:
var libPublisher = publisher.lib( options );
gulp.src('./lib/jquery/**')
.pipe( libPublisher.getStream() );
To publish the release version of your app or library, simply change devTag
property to version
.
In your options
variable:
var options = {
id: 'someID',
creds: require('./creds/keys.json'),
version: '4.2.1'
};
Make sure the version follows the guideline to Semantic Versioning of a valid version number.
Both the app()
and lib()
publisher methods accept the following options:
Property Name | Description |
---|---|
id | Unique name of the application or library. |
creds | Credential key/secret. Do not commit the secret to source control. Either load it from a file (which is excluded from source control) or use an environment or command-line variable. |
devTag | The development version of the application or library. |
version | The release version of the application or library. Unlike devTag, this property must follow the guideline to Semantic Versioning. |
To get the final location on the CDN of your files:
var appPublisher = require('gulp-frau-publisher').app( options );
var location = appPublisher.getLocation();