grunt-mobify-cloud
Advanced tools
Comparing version 1.0.12 to 1.1.0
@@ -50,3 +50,4 @@ /* | ||
settingsFile: settingsPath, | ||
message: grunt.option('message') || '' | ||
message: grunt.option('message') || '', | ||
target: grunt.option('deploy-to-target') || '' | ||
}, | ||
@@ -53,0 +54,0 @@ src: ['test/**', '!test/fixtures/creds'] |
@@ -28,3 +28,3 @@ var grunt = require('grunt'); | ||
destPath = srcPath.replace(/[^\/]+\//, ''); | ||
// And replace it with 'project-slug/bld/'. | ||
@@ -80,10 +80,26 @@ destPath = path.join(projectSlug, 'bld', destPath); | ||
exports.getProjectApiPath = function(origin, slug, path) { | ||
// Strip trailing slash. | ||
origin = origin.replace(/\/$/, ''); | ||
var stripLeadingAndTrailingSlashes = function(str) { | ||
return str.replace(/^\/|\/$/g, ''); | ||
}; | ||
// Strip leading slash. | ||
path = path.replace(/^\//, ''); | ||
// Join all segments and end with a slash | ||
var urlJoin = function(segments) { | ||
var isEmpty = function(x) { return !!x; } | ||
return segments.filter(isEmpty).join('/') + '/'; | ||
}; | ||
return origin + "/api/projects/" + slug + "/" + path; | ||
exports.getProjectApiPath = function(origin, slug, path, target) { | ||
target = target || ''; | ||
origin = stripLeadingAndTrailingSlashes(origin); | ||
path = stripLeadingAndTrailingSlashes(path); | ||
target = stripLeadingAndTrailingSlashes(target); | ||
return urlJoin([ | ||
origin, | ||
'api/projects', | ||
slug, | ||
path, | ||
target | ||
]); | ||
}; | ||
@@ -126,3 +142,3 @@ | ||
// Avoids DEPTH_ZERO_SELF_SIGNED_CERT error for self-signed certs | ||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; | ||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; | ||
@@ -132,3 +148,3 @@ var headers = this.getRequestHeaders(); | ||
var uri = this.getProjectApiPath( | ||
options.origin, options.projectSlug, 'builds/' | ||
options.origin, options.projectSlug, 'builds', options.target | ||
); | ||
@@ -151,8 +167,8 @@ var headers = this.getRequestHeaders( | ||
throwForStatus(response); | ||
console.log('Build uploaded!'); | ||
cb(); | ||
}); | ||
return request; | ||
}; |
{ | ||
"name": "grunt-mobify-cloud", | ||
"description": "A plugin for working with Mobify projects", | ||
"version": "1.0.12", | ||
"version": "1.1.0", | ||
"homepage": "http://cloud.mobify.com", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -43,2 +43,14 @@ # mobify-upload | ||
### deploy-to-target | ||
> type: string | ||
You can specify a target for the bundle and it will be auto-deployed to this | ||
target after the upload completes. This is useful for making the latest build | ||
of a project available automatically via a build server, for example. | ||
``` | ||
grunt mobify-upload --deploy-to-target="ci-development" | ||
``` | ||
# mobify-save_credentials | ||
@@ -77,2 +89,2 @@ | ||
export GITHUB_PASSWORD='myaccesstoken' | ||
``` | ||
``` |
@@ -12,3 +12,4 @@ module.exports = function(grunt) { | ||
settingsFile: Utils.getSettingsPath(), | ||
origin: 'https://cloud.mobify.com' | ||
origin: 'https://cloud.mobify.com', | ||
target: '' | ||
}); | ||
@@ -19,3 +20,4 @@ | ||
projectSlug: options.projectSlug, | ||
origin: options.origin | ||
origin: options.origin, | ||
target: options.target | ||
}; | ||
@@ -22,0 +24,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
55285
324
89
12
3