dasuchin / grunt-ssh-deploy

Grunt SSH Deployment
MIT License
66 stars 45 forks source link

Cannot call method 'join' of undefined #47

Closed siamkreative closed 9 years ago

siamkreative commented 9 years ago

Hi Dustin,

With the latest version (0.3.1), I always get this error Cannot call method 'join' of undefined. I tried both on Ubuntu 15 and Windows 10, same problem.

pasted image at 2015_09_10 12_00 pm

I tried with an older version of this plugin (0.2.6) and the deployment worked without changing anything in my Gruntfile.js (just updating the content of /node_modules/grunt-ssh-deploy) . But I need the features that have been recently introduced (options.release_subdir + options.release_root).

I tried running grunt ssh_deploy:digitalocean --debug but it didn't help me figure out what's wrong. Please let me know what debug information I should provide you to help me solve this.

Thanks!

PS: I'm cc'ing @julien731

dasuchin commented 9 years ago

What does your package.json and grunt task look like for it? Also what version of node do you have installed locally? I'm wondering if it's out of date even though this package has a certain version requirement.

siamkreative commented 9 years ago

Hi Dustin,

Thanks for looking into this.

Package.json

{
  "name": "getawesomesupport.com",
  "version": "0.1.1",
  "private": true,
  "devDependencies": {
    "grunt": "~0.4.2",
    "grunt-autoprefixer": "~0.8.2",
    "grunt-contrib-concat": "^0.5.0",
    "grunt-contrib-jshint": "^0.10.0",
    "grunt-contrib-less": "^0.12.0",
    "grunt-contrib-uglify": "~0.5.1",
    "grunt-contrib-watch": "~0.5.3",
    "grunt-dploy": "0.0.2",
    "grunt-grunticon": "~1.0.0",
    "grunt-keycdn": "0.0.3",
    "grunt-ssh-deploy": "^0.3.1",
    "grunt-svgstore": "~0.3.0",
    "grunt-uncss": "^0.3.8",
    "load-grunt-tasks": "~0.2.1"
  }
}

Deployment task

environments: {
    options: {
        local_path: 'test',
        current_symlink: 'awesome-support',
        deploy_path: '/srv/users/serverpilot/apps/wordpress/public/wp-content/themes'
    },
    digitalocean: {
        options: {
            host: '<%= secret.production.host %>',
            username: '<%= secret.production.username %>',
            password: '<%= secret.production.password %>',
            port: '<%= secret.production.port %>',
            releases_to_keep: '5',
            release_root: '/srv/users/serverpilot/apps/wordpress/public/wp-content/themes_releases'
        }
    }
},

Node version

image 0.10.31

Do you also need to check the results of npm list to see the locally installed packages? Is there anything else that I can provide to help figure this out?

Thanks

dasuchin commented 9 years ago

Try upgrading your version of node/npm.

siamkreative commented 9 years ago

God dammit, that worked! Many thanks

I installed the latest version of node/npm, and re-install all Grunt dependencies (remove the folder /node_modules/ and run npm install).

But when I deployed, I realized that there is another problem (linked with issue #30). With my current deployment task:

The generated release_root path is

/srv/users/serverpilot/apps/wordpress/public/wp-content/themes/srv/users/serverpilot/apps/wordpress/public/wp-content/themes_releases/20150915101703473

I want it to be only

/srv/users/serverpilot/apps/wordpress/public/wp-content/themes_releases

Is it possible to configure the grunt task like this release_root: '../themes_releases'?

dasuchin commented 9 years ago

Try setting release_root to just themes_releases since you already have deploy_path set to the directory.

siamkreative commented 9 years ago

I managed to finally get everything and I'm really happy with this deployment workflow. Here's the final task:

environments: {
    options: {
        local_path: 'dist',
        current_symlink: 'awesome-support',
        deploy_path: '/srv/users/serverpilot/apps/wordpress/public/wp-content/themes'
    },
    digitalocean: {
        options: {
            host: '<%= secret.production.host %>',
            username: '<%= secret.production.username %>',
            password: '<%= secret.production.password %>',
            port: '<%= secret.production.port %>',
            releases_to_keep: '5',
            release_root: '../themes_releases',
            zip_deploy: true
        }
    }
},
grunt.registerTask('deploy', ['build', 'copy:before_deploy', 'ssh_deploy:digitalocean', 'clean:after_deploy', 'keycdn:purgeZone']);

Thanks for the help.