-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
45 lines (40 loc) · 1.26 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
pipeline {
agent any
environment {
GITHUB_REPO_URL = 'https://github.com/ashahidkhattak/test.git'
LINUX_SERVER = '192.168.1.13'
LINUX_USERNAME = 'osboxes'
LINUX_DESTINATION = './testweb/'
}
stages {
stage('Checkout') {
steps {
script {
// Clone the GitHub repository
bat "git clone ${env.GITHUB_REPO_URL}"
}
}
}
stage('Deploy to Linux') {
steps {
script {
// Copy the extracted files to the Linux server
def sourcePath = "C:\Users\AbdulShahid\testweb"
def remoteUsername = "osboxes"
def remoteHostname = "192.168.1.13"
def remotePath = "./testweb/"
// Use 'bat' step to run pscp command for copying files
bat """
"C:\\Program Files\\PuTTY\\pscp.exe" -pw osboxes.org "${sourcePath}\\*" ${remoteUsername}@${remoteHostname}:${remotePath}
"""
}
}
}
}
post {
always {
// Clean up workspace
deleteDir()
}
}
}