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 26, 2018 in DevOps & Agile by stephen
• 340 points

edited Oct 11, 2018 by Kalgi 125 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,160 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 26, 2018 in DevOps & Agile by ajs3033
• 7,280 points

edited Oct 16, 2018 by Kalgi 760 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
• 46,210 points
67 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,280 points
115 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,280 points
188 views
+13 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
264 views
0 votes
1 answer