-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
27 lines (27 loc) · 867 Bytes
/
Jenkinsfile
File metadata and controls
27 lines (27 loc) · 867 Bytes
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
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Application build stage...'
}
}
stage('Test') {
steps {
// Remove existing files on the remote server first
sh '''
gcloud compute ssh root@ali-devops-project-server --zone=us-central1-a -- "rm -rf /var/www/html/*"
'''
// Then copy new files from Jenkins workspace to the remote server
sh '''
gcloud compute scp --recurse /var/lib/jenkins/workspace/Dev-Op-Project_main/* root@ali-devops-project-server:/var/www/html --zone=us-central1-a
'''
}
}
stage('Run') {
steps {
echo 'Application run stage'
}
}
}
}