forked from adam/discord-bot-shtik
Compare commits
No commits in common. "c42d6d3bc5d03d6873f421f430494ea267ffc674" and "7c10b0011068b74b01473266e80031d22f8b0c4b" have entirely different histories.
c42d6d3bc5
...
7c10b00110
13
Jenkinsfile
vendored
13
Jenkinsfile
vendored
@ -24,7 +24,6 @@ pipeline {
|
||||
testcmd mktemp
|
||||
testcmd curl
|
||||
testcmd git
|
||||
testcmd rsync
|
||||
testcmd sed
|
||||
testcmd ssh
|
||||
testcmd ssh-keyscan
|
||||
@ -44,7 +43,7 @@ pipeline {
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
dotnetBuild(outputDirectory: "dist", project: "vassago.csproj")
|
||||
dotnetBuild(outputDirectory: "./dist", project: "vassago.csproj")
|
||||
archiveArtifacts artifacts: 'dist/*'
|
||||
}
|
||||
}
|
||||
@ -59,8 +58,8 @@ pipeline {
|
||||
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccountID, keyFileVariable: 'PK')])
|
||||
{
|
||||
sh """#!/bin/bash
|
||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'rm -rf temp_deploy'
|
||||
rsync -e \"ssh -i \"${PK}\"\" -a dist/ ${linuxServiceAccount_USR}@${env.targetHost}:temp_deploy/
|
||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'rm -rf temp_deploy & mkdir -p temp_deploy'
|
||||
scp -i \"${PK}\" -r dist/ ${linuxServiceAccount_USR}@${env.targetHost}:temp_deploy
|
||||
"""
|
||||
}
|
||||
}
|
||||
@ -106,11 +105,9 @@ pipeline {
|
||||
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccountID, keyFileVariable: 'PK')])
|
||||
{
|
||||
sh """#!/bin/bash
|
||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'cp -r dist oldgood-\$(mktemp -u XXXX)'
|
||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'cp dist oldgood-\$(mktemp -u XXXX)'
|
||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'mv dist/appsettings.json appsettings.json'
|
||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'rm -rf dist'
|
||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'rsync -r temp_deploy/ dist/'
|
||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'rm -rf temp_deploy'
|
||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'rm -rf dist/ && shopt -s dotglob & mv temp_deploy/* dist/'
|
||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'mv appsettings.json dist/appsettings.json'
|
||||
"""
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user