-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
35 lines (30 loc) · 888 Bytes
/
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
def remote = [:]
remote.name = 'test_node1'
remote.host = '45.126.125.65'
remote.user = 'agent'
remote.password = '12345678'
remote.allowAnyHosts = true
pipeline {
agent any
stages {
stage('back_publish_dev') {
steps {
dotnetClean(showSdkInfo: true, workDirectory: 'Botticelli', charset: 'Utf8', framework: 'net8.0', nologo: true)
sh ''' dotnet publish Botticelli -o publish -r linux-x64 --self-contained false '''
}
}
stage('publish_to_node1') {
steps {
catchError {
sshPut(remote: remote, from: 'publish', into: '/deploy/server_back')
}
}
}
stage('run on node 1') {
steps {
sshCommand(command: 'pkill -f Botticelli.Server | true', remote: remote)
sshCommand(command: ' cd /deploy/server_back/publish | dotnet run', remote: remote)
}
}
}
}