i have a project in grunt and can scp to different servers and copy stuff with grunt scp
but every time when i have to scp to either test or production i have to change the host name in gruntfile.js
and then commit it back to svn
in order to run it via jenkins.So what i want is to create some environment varible on the basis of which my i can add some parameters in jenkins and when i select any of the parameter e.g. test
by build will get deploy to test and so on. my scp code is below
scp: {
options: {
host: 'testserver',
username: 'user',
privateKey: fs.readFileSync('/repository/server/.ssh/id_rsa_robot'),
tryKeyboard: true
},
dist: {
files: [{
cwd: './dist',
src: '**/*',
filter: 'isFile',
// path on the server
dest: '/path/to/deploy/project.test'
}]
}
}
i want to use something like
grunt deploy:test
or
grunt deploy:production
and ask jenkins
to do that scp
please help !!