GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( f1f188...682054 )
by Stefano
02:33
created

ssh.then   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
nc 2
nop 4
dl 0
loc 7
rs 9.4285
1
var path = require('path');
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2
var fs = require('fs');
3
var JSZip = require("jszip");
4
var rsync = require("rsyncwrapper");
5
var chalk = require('chalk');
6
var node_ssh = require('node-ssh');
7
var ssh = new node_ssh();
0 ignored issues
show
Coding Style Best Practice introduced by
By convention, constructors like node_ssh should be capitalized.
Loading history...
8
9
process.stdout.write("Deploy externalLogin on DEV.\n");
10
11
ssh.connect({
12
  host: 'www.d1b0.local',
13
  username: 'developer',
14
  privateKey: './server/plays/ssh/developer.key',
15
  port: 2222
16
}).then(function() {
17
  var nextCommand = ssh.mkdir('/var/www/auth.local/src/');
18
  // @see: https://github.com/steelbrain/node-ssh/blob/master/src/index.js
19
  nextCommand.then( function(){
20
    ssh.exec('rm', ['-rf', 'public'], { cwd: '/var/www/auth.local', stream: 'both' }).then( function(both){
0 ignored issues
show
Unused Code introduced by
The parameter both is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
21
      ssh.exec('ln', ['-s','web','public'], { cwd: '/var/www/auth.local', stream: 'both' }).then( function(both){
0 ignored issues
show
Unused Code introduced by
The parameter both is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
22
          ssh.dispose();
23
          process.stdout.write("prepare dir COMPLETED.\n");
24
25
          process.stdout.write("Start rsync src.\n");
26
27
          rsync({
28
              src: "./applications/externalLogin/",
29
              dest: "[email protected]:/var/www/auth.local/",
30
              ssh: true,
31
              privateKey: './server/plays/ssh/developer.key',
32
              port: 2222,
33
              exclude: [ 'test', '.DS_Store', 'phpunit.xml', 'README.md', 'vendor' ],
34
              recursive: true,
35
              deleteAll: false //senno elimina log!
36
          },function (error,stdout,stderr,cmd) {
37
              if ( error ) {
38
                  process.stderr.write('CMD: '+cmd+"\n");
39
                  process.stderr.write(chalk.red(error.message)+"\n");
40
                  process.exit(1);
0 ignored issues
show
Compatibility Debugging Code Best Practice introduced by
Use of process.exit() is discouraged as it will potentially stop the complete node.js application. Consider quitting gracefully instead by throwing an Error.
Loading history...
41
              }
42
          });
43
44
          process.stdout.write("Composer install.\n");
45
46
          ssh.connect({
47
            host: 'www.d1b0.local',
48
            username: 'developer',
49
            privateKey: './server/plays/ssh/developer.key',
50
            port: 2222
51
          }).then(function() {
52
            ssh.exec('composer', ['install', '--no-dev', '--optimize-autoloader', '--no-interaction', '--no-progress', '--no-scripts'], { cwd: '/var/www/auth.local/', stream: 'both' }).then(function(both) {
53
              process.stdout.write(chalk.cyan(both.stdout)+"\n");
54
              if ( both.code === 0 ){
55
                process.stdout.write(chalk.cyan(both.stderr)+"\n");
56
              } else {
57
                process.stdout.write(chalk.red(both.stderr)+"\n");
58
                process.exit(1);
0 ignored issues
show
Compatibility Debugging Code Best Practice introduced by
Use of process.exit() is discouraged as it will potentially stop the complete node.js application. Consider quitting gracefully instead by throwing an Error.
Loading history...
59
              }
60
              process.stdout.write("Deploy COMPLETED.\n");
61
              ssh.dispose();
62
            });
63
          });
64
65
      });
66
    });
67
  });
68
});
69