Compare commits

..

5 Commits

Author SHA1 Message Date
c42d6d3bc5 trailing slash on both.
Some checks failed
gitea.arg.rip/vassago/pipeline/head There was a failure building this commit
2025-05-15 12:14:00 -04:00
e511f1c5ee shrug let's try a trailing slash on temp_deploy?
All checks were successful
gitea.arg.rip/vassago/pipeline/head This commit looks good
2025-05-15 12:05:13 -04:00
7b0f792e66 rsync needs to -e "ssh -i "pk"". begin quotation escaping hell.
All checks were successful
gitea.arg.rip/vassago/pipeline/head This commit looks good
2025-05-15 12:01:40 -04:00
aaf7c3b2f5 deployment tweak
Some checks failed
gitea.arg.rip/vassago/pipeline/head There was a failure building this commit
2025-05-15 11:56:26 -04:00
b026dda003 cp -r
All checks were successful
gitea.arg.rip/vassago/pipeline/head This commit looks good
2025-05-15 11:18:25 -04:00

13
Jenkinsfile vendored
View File

@ -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'
"""
}