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