Scp Php files into server using gradle

+1 vote

I am having problem in transferring PHP Files into sever Using gradle .I  have already tried with below script but i don't  know how to pass username and password.

plugins {
  id 'org.hidetake.ssh' version 'x.y.z'
}
remotes {
  webServer {
    host = '192.168.1.101'
    user = 'jenkins'
    identity = file('id_rsa')
  }
}
task deploy {
  doLast {
    ssh.run {
      session(remotes.webServer) {
        put from: 'example.war', into: '/webapps'
      }
    }
  }
}
Mar 27, 2018 in DevOps & Agile by stephen
• 340 points

edited Oct 11, 2018 by Kalgi 1,561 views

2 answers to this question.

0 votes

For development purpose seems you don't need to ssh into vagrant,

 I am having this setting in my docker-compose.yml :

dl_db:
 image: mysql:5.7 
ports: - 3306:3306
 environment: 
- MYSQL_ROOT_PASSWORD=root 
- MYSQL_DATABASE=oemjih 
restart: always

Put this line in your vagrantfile

config.vm.network :forwarded_port, guest: 3306, host: 3306

and from your sqlyog panel just accessing the db via tcp/ip with port:3306 as mapped in as host port in vagrantfile without ssh :

MySql Host Address: localhost
username : root 
password : root 
port : 3306
answered Mar 29, 2018 by DeanWinchester

edited Oct 11, 2018 by Kalgi
0 votes

Tru something like this:

plugins {
  id 'org.hidetake.ssh' version '2.9.0'  
}
ssh.settings {
knownHosts = allowAnyHosts
}
remotes {
  webServer {
    host = 'ip'
    user = 'username'
    password='password'
  }
}

task deploy {
  doLast {
    ssh.run {
      session(remotes.webServer) {
        put from: 'src', into: '/home/Desktop/Gradle'

      }
    }
  }
answered Oct 11, 2018 by lina
• 8,220 points

Related Questions In DevOps & Agile

+13 votes
2 answers
+2 votes
2 answers

how to set different provisioning profiles for different targets using Xcode Build

For multiple targets, each task has to ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by ajs3033
• 7,300 points

edited Oct 16, 2018 by Kalgi 4,818 views
+5 votes
2 answers

Bootstrap SPAapp using Heroku commands

I've made a few assumptions You want to ...READ MORE

answered Oct 16, 2018 in DevOps & Agile by Kalgi
• 52,350 points
1,081 views
+6 votes
5 answers

can't remove SSIS variables using remove method on PowerShell

you're missing the additional $environment.Alter() after your ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by ajs3033
• 7,300 points
2,633 views
+1 vote
2 answers
0 votes
1 answer

unable to build .Net project using NUGet

you just need the developer pack for ...READ MORE

answered Apr 3, 2018 in DevOps & Agile by ajs3033
• 7,300 points
933 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,034 views
+2 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP