30 lines
1.3 KiB
Plaintext
30 lines
1.3 KiB
Plaintext
|
pipeline {
|
||
|
agent any
|
||
|
|
||
|
stages {
|
||
|
stage('Deploy') {
|
||
|
when {
|
||
|
branch pattern: '^(master|main)$|stable|release', comparator: 'REGEXP'
|
||
|
}
|
||
|
|
||
|
steps {
|
||
|
httpRequest outputFile: 'get_service_config.yaml', url: 'https://gist.githubusercontent.com/computer-geek64/3ed7241e7a74ad6ddd00409900b590e4/raw/39d371d4040b319663bfd339ea1aa56bd37cdf77/get_service_config.yaml'
|
||
|
ansiblePlaybook credentialsId: 'rivendell-ssh-key', disableHostKeyChecking: true, extras: "--extra-vars 'service=\"archer_a9_router_rebooter\"'", playbook: 'get_service_config.yaml'
|
||
|
script {
|
||
|
archer_a9_router_rebooter_config = readJSON file: 'archer_a9_router_rebooter_config.json'
|
||
|
}
|
||
|
|
||
|
ansiblePlaybook credentialsId: 'rivendell-ssh-key', disableHostKeyChecking: true, extras: "--extra-vars 'router_password=\"${archer_a9_router_rebooter_config.router.password}\"'", playbook: 'install.yaml'
|
||
|
ansiblePlaybook credentialsId: 'rivendell-ssh-key', disableHostKeyChecking: true, playbook: 'stop.yaml'
|
||
|
ansiblePlaybook credentialsId: 'rivendell-ssh-key', disableHostKeyChecking: true, playbook: 'start.yaml'
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
post {
|
||
|
cleanup {
|
||
|
cleanWs()
|
||
|
}
|
||
|
}
|
||
|
}
|