Skip to content

Commit

Permalink
make TEST_SCP a command line arg, see #163
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsamuel137 committed Jul 15, 2015
1 parent b3afa1a commit 7bc6f0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 3 additions & 2 deletions js/grunt/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,14 @@ module.exports = function( grunt ) {
grunt.registerTask( 'deploy-dev',
'Deploy a dev version to spot, or optionally to the server in your preferences file\n' +
'--buildServer : build the sim with the build server if true\n' +
'--debug : log ssh debug info if true\n',
'--debug : log ssh debug info if true\n' +
'--test : set to true to disable commit and push, and SCP to a test directory on spot\n',
function() {
if ( grunt.option( 'buildServer' ) ) {
deploySimulation( grunt, 'simian' );
}
else {
deployDev( grunt, grunt.option( 'debug' ) );
deployDev( grunt, grunt.option( 'debug' ), grunt.option( 'test' ) );
}
}
);
Expand Down
9 changes: 4 additions & 5 deletions js/grunt/deployDev.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ var BUILD_DIR = 'build';
var PACKAGE_JSON = 'package.json';
var DEPENDENCIES_JSON = 'dependencies.json';

var TEST_SCP = false; // set to true to disable commit and push, and SCP to a test directory on spot

/**
* @param grunt the grunt instance
* @param debug log ssh debug info if true
* @param test set to true disable commit and push, and SCP to a test directory on spot
*/
module.exports = function( grunt, debug ) {
module.exports = function( grunt, debug, test ) {
'use strict';

// read the preferences file
Expand All @@ -48,7 +47,7 @@ module.exports = function( grunt, debug ) {
// get the server name and server path if they are in the preferences file, otherwise use defaults
var server = preferences.devDeployServer || DEV_SERVER;
var basePath = preferences.devDeployPath || DEV_DIRECTORY;
if ( TEST_SCP ) {
if ( test ) {
basePath += 'ad-tests/';
URL_BASE += 'ad-tests/';
}
Expand Down Expand Up @@ -118,7 +117,7 @@ module.exports = function( grunt, debug ) {
} );
};

if ( !TEST_SCP ) {
if ( !test ) {
exec( 'git add ' + DEPENDENCIES_JSON, function() {
exec( 'git commit --message "updated ' + DEPENDENCIES_JSON + ' for ' + version + ' "', function() {
exec( 'git push', function() {
Expand Down

0 comments on commit 7bc6f0f

Please sign in to comment.