Browse Source

Merge branch 'master' of http://git.bbh/chess/elxr

production
Pradeep Bhaskaran 4 years ago
parent
commit
ef4dcd607c
1 changed files with 16 additions and 8 deletions
  1. 16
    8
      index.js

+ 16
- 8
index.js View File



var path = require('path'); var path = require('path');
const { isMaster } = require('cluster'); const { isMaster } = require('cluster');

// Default Config...
var reposervers = [
'http://git.bbh'
, '//172.16.0.27/repos'
]
var defaultRepoServer = reposervers[0]

var currentGitAuthUser ; // nodeShellExec('git', ['config', 'user.email']) ... PB : TODO-- get the current gittea username
var defaultRepoOwner = 'chess';

// Serialize a set of functions that will execute to return a promises one after the other. // Serialize a set of functions that will execute to return a promises one after the other.
// Will stop when any one fails unless continueOnFailure is true. // Will stop when any one fails unless continueOnFailure is true.
// All tasks in iterables can be functions or promises. // All tasks in iterables can be functions or promises.
, 'elxr' , 'elxr'
, 'ember-searchable-select' , 'ember-searchable-select'
, 'loopback-component-jsonapi' , 'loopback-component-jsonapi'
, 'loopback-jsonapi-model-serializer'
, 'elixir-config-development' , 'elixir-config-development'
, 'elixir-config-test' , 'elixir-config-test'
, 'cihsr-config' , 'cihsr-config'
// git push origin master // git push origin master


var repo = processedArgs._[1]; var repo = processedArgs._[1];
var reposervers = [
'http://git.bbh'
, '//172.16.0.27/repos'
]
var defaultRepoServer = reposervers[0]

var sequentialTaskShellCommands = []; var sequentialTaskShellCommands = [];
if(!existsSync(`Z:/${repo}.git`)){ if(!existsSync(`Z:/${repo}.git`)){
sequentialTaskShellCommands = [ sequentialTaskShellCommands = [
} }
else { else {
console.log('cloning ' + repo) console.log('cloning ' + repo)
return nodeShellExec('git', ['clone', '-c', 'core.symlinks=true', defaultRepoServer + '/' + repo + '.git'],
// PB : TODO -- detect if a clonable repo exists in currentGitAuthUser
return nodeShellExec('git', ['clone', '-c', 'core.symlinks=true', defaultRepoServer + `/${defaultRepoOwner}/` + repo + '.git'],
{ {
inherit : true, shell: true, inherit : true, shell: true,
env: process.env env: process.env
env: process.env env: process.env
, cwd : repo , cwd : repo
, runas : processedArgs.runas , runas : processedArgs.runas
, title : `git core.symlinks --replace-all true for ${defaultRepoServer + '/' + repo + '.git'}`
, title : `git core.symlinks --replace-all true for ${defaultRepoServer + `/${defaultRepoOwner}/` + repo + '.git'}`
}) })
}) })
} }

Loading…
Cancel
Save