boom-deploy
Advanced tools
Comparing version 0.2.70 to 0.2.71
@@ -662,3 +662,3 @@ | ||
var dumpName = ['dump', export_env, exportCassandra.keyspace, get('timestamp'), get('login'), md5()].join('_') + '.cql.bz2'; | ||
var dumpName = ['dump', export_env, exportCassandra.keyspace, get('timestamp'), get('login'), md5()].join('_'); | ||
@@ -671,10 +671,10 @@ var schema = get('schema'); | ||
function removeDump(){ | ||
lazySsh('rm -f {{cassandraDumpDir}}/' + dumpName) | ||
lazySsh('rm -rf {{cassandraDumpDir}}/' + dumpName + '*') | ||
} | ||
function makeDumpDir(){ | ||
lazySsh('mkdir -p {{cassandraDumpDir}}'); | ||
lazySsh('mkdir -p {{cassandraDumpDir}}/' + dumpName); | ||
} | ||
function cleanup(){ | ||
// очистка прерванных дампов | ||
lazySsh('find {{cassandraDumpDir}}/ -type f -name "*.bz2" -mmin +300 | xargs rm -f'); | ||
lazySsh('find {{cassandraDumpDir}}/ -mindepth 1 -maxdepth 1 -name "dump_*" -mmin +300 | xargs rm -rf'); | ||
} | ||
@@ -691,8 +691,14 @@ | ||
function cqlsh(cmd){ | ||
return lazySsh('cqlsh ' + exportCassandra.host + ' --cqlversion=3.4.0 -e \"' + cmd + '\"'); | ||
} | ||
function cqlshDesc(table){ | ||
lazySsh('cqlsh ' + exportCassandra.host + ' --cqlversion=3.4.0 -e \"DESC ' + exportCassandra.keyspace + (table ? '.' + table : '') + '\"'); | ||
return cqlsh('DESC ' + exportCassandra.keyspace + (table ? '.' + table : '')); | ||
} | ||
function cqlshCopyTo(table){ | ||
lazySsh('cqlsh ' + exportCassandra.host + ' --cqlversion=3.4.0 -e \"SELECT * FROM ' + exportCassandra.keyspace + '.' + table + ' LIMIT 10\"'); | ||
return lazySsh('cqlsh ' + exportCassandra.host + | ||
' --cqlversion=3.4.0 -e "SELECT * FROM ' + exportCassandra.keyspace + '.' + table + | ||
' LIMIT 10" > {{cassandraDumpDir}}/' + dumpName + '/' + table + '.txt'); | ||
} | ||
@@ -711,2 +717,20 @@ | ||
tables.forEach(cqlshCopyTo); | ||
lazySsh( | ||
'cd {{cassandraDumpDir}}/' + dumpName, | ||
'tar -zcvf ../' + dumpName + '.tar.gz ./' | ||
); | ||
lazySsh('du -sh {{cassandraDumpDir}}/' + dumpName + '.tar.gz'); | ||
switchEnv(import_env); | ||
makeDumpDir(); | ||
rsyncFrom(export_env, '{{cassandraDumpDir}}/' + dumpName + '.tar.gz', '{{cassandraDumpDir}}'); | ||
lazySsh('tar -xvzf {{cassandraDumpDir}}/' + dumpName + '.tar.gz -C {{cassandraDumpDir}}/' + dumpName); | ||
lazySsh('tail {{cassandraDumpDir}}/' + dumpName + '/*'); | ||
removeDump(); | ||
cleanup(); | ||
switchEnv(export_env); | ||
removeDump(); | ||
cleanup(); | ||
} | ||
@@ -716,2 +740,8 @@ | ||
new Helper(function rsyncFrom(env, from, to){ | ||
var config = getConfig(env); | ||
lazySsh('rsync -av --progress -e \'ssh -p ' + config.port +'\' ' + config.user + '@' + config.server + ':' + from + ' ' + to); | ||
}); | ||
new Helper(function staticCopy(import_env, dir){ | ||
@@ -718,0 +748,0 @@ |
{ | ||
"name": "boom-deploy", | ||
"main": "boom.js", | ||
"version": "0.2.70", | ||
"version": "0.2.71", | ||
"description": "deploy your app", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
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
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
90532
2535