feat: new client, store and docs
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
pipeline {
|
||||
agent none
|
||||
|
||||
parameters {
|
||||
choice(
|
||||
name: 'TIENDA',
|
||||
choices: ['oficina'],
|
||||
description: 'Tienda destino'
|
||||
)
|
||||
string(
|
||||
name: 'NODO',
|
||||
defaultValue: '',
|
||||
description: 'Nombre exacto del nodo a deployar (vacío = toda la tienda)'
|
||||
)
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Preparar scripts') {
|
||||
agent { label 'built-in' }
|
||||
steps {
|
||||
sh 'cp /opt/deploy/install.sh .'
|
||||
stash name: 'scripts', includes: 'install.sh'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy') {
|
||||
agent { label 'built-in' }
|
||||
steps {
|
||||
script {
|
||||
def labelExpr = "lab && ${params.TIENDA}"
|
||||
def nodes = nodesByLabel(label: labelExpr, offline: false)
|
||||
if (params.NODO?.trim()) {
|
||||
def target = params.NODO.trim()
|
||||
if (!nodes.contains(target)) {
|
||||
error "El nodo '${target}' no está online o no pertenece al label: ${labelExpr}"
|
||||
}
|
||||
nodes = [target]
|
||||
}
|
||||
if (nodes.isEmpty()) {
|
||||
error "No hay nodos online con el label: ${labelExpr}"
|
||||
}
|
||||
def deployStages = nodes.collectEntries { nodeName ->
|
||||
["Deploy ${nodeName}": {
|
||||
node(nodeName) {
|
||||
unstash 'scripts'
|
||||
sh "bash install.sh 'lab'"
|
||||
}
|
||||
}]
|
||||
}
|
||||
parallel deployStages
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user