tweakin
This commit is contained in:
+20
-17
@@ -2,7 +2,7 @@ pipeline {
|
|||||||
agent any
|
agent any
|
||||||
parameters {
|
parameters {
|
||||||
booleanParam(name: 'backuplocally', defaultValue: params.backuplocally ?: false, description: 'If true local BORG backup will be created')
|
booleanParam(name: 'backuplocally', defaultValue: params.backuplocally ?: false, description: 'If true local BORG backup will be created')
|
||||||
booleanParam(name: 'backuptostackstorage', defaultValue: false, description: 'If true backup data to TransIP Stack')
|
// booleanParam(name: 'backuptostackstorage', defaultValue: false, description: 'If true backup data to TransIP Stack')
|
||||||
booleanParam(name: 'backuptodavid', defaultValue: params.backuptodavid ?: false, description: 'If true rsync the BORG repository to David')
|
booleanParam(name: 'backuptodavid', defaultValue: params.backuptodavid ?: false, description: 'If true rsync the BORG repository to David')
|
||||||
booleanParam(name: 'backuptowinschoten', defaultValue: params.backuptowinschoten ?: false, description: 'If true rsync the BORG repository to our Winschoten backup system')
|
booleanParam(name: 'backuptowinschoten', defaultValue: params.backuptowinschoten ?: false, description: 'If true rsync the BORG repository to our Winschoten backup system')
|
||||||
string(name: 'directory', defaultValue: params.directory ?: ' ', description: 'The directory that should be handled')
|
string(name: 'directory', defaultValue: params.directory ?: ' ', description: 'The directory that should be handled')
|
||||||
@@ -17,7 +17,7 @@ pipeline {
|
|||||||
script { env.backuptostackstorage = false }
|
script { env.backuptostackstorage = false }
|
||||||
echo "Backing up directory ${env.storagelocation}/${directory}"
|
echo "Backing up directory ${env.storagelocation}/${directory}"
|
||||||
echo "Local BORG backup creation is ${params.backuplocally}"
|
echo "Local BORG backup creation is ${params.backuplocally}"
|
||||||
echo "Backup to TransIP Stack is ${params.backuptostackstorage}"
|
// echo "Backup to TransIP Stack is ${params.backuptostackstorage}"
|
||||||
echo "Backup to David is ${params.backuptodavid}"
|
echo "Backup to David is ${params.backuptodavid}"
|
||||||
echo "Backup to Winschoten PI is ${params.backuptowinschoten}"
|
echo "Backup to Winschoten PI is ${params.backuptowinschoten}"
|
||||||
sh "echo '${params.excludelist}' >> excludelist"
|
sh "echo '${params.excludelist}' >> excludelist"
|
||||||
@@ -67,22 +67,25 @@ pipeline {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
stage('Rsync TEST') {
|
stage('Rsync TEST') {
|
||||||
steps {
|
failFast false
|
||||||
script {
|
parallel {
|
||||||
if (params.backuptodavid) {
|
steps {
|
||||||
sh "rsync -v -a -e 'ssh -p 664' --delete --bwlimit=3000 --info=progress2 ${env.borglocation}/${directory} matthias@home.daf2000.nl:/media/disk/borgbackup/"
|
script {
|
||||||
} else {
|
if (params.backuptodavid) {
|
||||||
echo "Backup to David is skipped"
|
sh "rsync -v -a -e 'ssh -p 664' --delete --bwlimit=3000 --info=progress2 ${env.borglocation}/${directory} matthias@home.daf2000.nl:/media/disk/borgbackup/"
|
||||||
}
|
} else {
|
||||||
}
|
echo "Backup to David is skipped"
|
||||||
script {
|
}
|
||||||
if (params.backuptowinschoten) {
|
}
|
||||||
withCredentials([sshUserPrivateKey(credentialsId: 'backupwinschoten', keyFileVariable: 'keyfile', passphraseVariable: 'passphrase', usernameVariable: 'user')]) {
|
script {
|
||||||
sh "cp ${keyfile} ${WORKSPACE}/keyfile"
|
if (params.backuptowinschoten) {
|
||||||
sh "rsync -v -a -e 'ssh -i /home/backupwinschoten/.ssh/id_rsa -p 9897' --delete --info=progress2 ${env.borglocation}/${directory} backupwinschoten@localhost:/storage/borgbackups/"
|
withCredentials([sshUserPrivateKey(credentialsId: 'backupwinschoten', keyFileVariable: 'keyfile', passphraseVariable: 'passphrase', usernameVariable: 'user')]) {
|
||||||
|
sh "cp ${keyfile} ${WORKSPACE}/keyfile"
|
||||||
|
sh "rsync -v -a -e 'ssh -i /home/backupwinschoten/.ssh/id_rsa -p 9897' --delete --info=progress2 ${env.borglocation}/${directory} backupwinschoten@localhost:/storage/borgbackups/"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "Backup to Winschoten is skipped"
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
echo "Backup to External PI is skipped"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user