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 mktemp
|
||||||
testcmd curl
|
testcmd curl
|
||||||
testcmd git
|
testcmd git
|
||||||
testcmd rsync
|
|
||||||
testcmd sed
|
testcmd sed
|
||||||
testcmd ssh
|
testcmd ssh
|
||||||
testcmd ssh-keyscan
|
testcmd ssh-keyscan
|
||||||
@ -44,7 +43,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
dotnetBuild(outputDirectory: "dist", project: "vassago.csproj")
|
dotnetBuild(outputDirectory: "./dist", project: "vassago.csproj")
|
||||||
archiveArtifacts artifacts: 'dist/*'
|
archiveArtifacts artifacts: 'dist/*'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -59,8 +58,8 @@ pipeline {
|
|||||||
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccountID, keyFileVariable: 'PK')])
|
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccountID, keyFileVariable: 'PK')])
|
||||||
{
|
{
|
||||||
sh """#!/bin/bash
|
sh """#!/bin/bash
|
||||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'rm -rf temp_deploy'
|
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'rm -rf temp_deploy & mkdir -p temp_deploy'
|
||||||
rsync -e \"ssh -i \"${PK}\"\" -a dist/ ${linuxServiceAccount_USR}@${env.targetHost}: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')])
|
withCredentials([sshUserPrivateKey(credentialsId: env.linuxServiceAccountID, keyFileVariable: 'PK')])
|
||||||
{
|
{
|
||||||
sh """#!/bin/bash
|
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} 'mv dist/appsettings.json appsettings.json'
|
||||||
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'rm -rf dist'
|
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'rm -rf dist/ && shopt -s dotglob & mv temp_deploy/* 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'
|
ssh -i \"${PK}\" -tt ${linuxServiceAccount_USR}@${targetHost} 'mv appsettings.json dist/appsettings.json'
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user