Jenkins + Minio + Prometheus + Grafana v1

This commit is contained in:
2026-09-01 13:42:14 +00:00
commit 05a197b0d0
21 changed files with 2256 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
FROM jenkins/jenkins:2.541.3-jdk21
USER root
RUN apt-get update && apt-get install -y curl git && rm -rf /var/lib/apt/lists/*
USER jenkins
RUN jenkins-plugin-cli --plugins \
configuration-as-code \
credentials-binding \
git \
workflow-aggregator \
job-dsl \
pipeline-utility-steps
COPY jenkins.yaml /usr/share/jenkins/ref/jenkins.yaml
ENV CASC_JENKINS_CONFIG=/usr/share/jenkins/ref/jenkins.yaml
+82
View File
@@ -0,0 +1,82 @@
#!/bin/sh
### DOWNLOAD MC
if [ ! -f /usr/local/bin/mc ]; then
curl -L https://dl.min.io/client/mc/release/linux-amd64/mc -o /usr/local/bin/mc
chmod +x /usr/local/bin/mc
fi
systemctl stop scoserver.service
systemctl stop scodocker.service
docker rmi cpi-server:latest gotenberg/gotenberg:8-chromium jumpmind/symmetricds:3.15.16 html-converter:latest mysql:8.0.32
### UPDATE SOFTWARE
SERVER=minio-api.laoficina1782.com
CUSTOMER="${1:?Uso: $0 <customer> <sucursal> <sco_number>}"
mc --config-dir /tmp/mc-config alias set minio "https://$SERVER" minioadmin LIGTNbUgQr
mc --config-dir /tmp/mc-config mirror --json --remove --overwrite --exclude "backend/docker/data/**" "minio/$CUSTOMER" /opt/sco/
find /opt/sco/ -type d -exec chmod 755 {} \;
find /opt/sco/ -type f -exec chmod 644 {} \;
chmod -R 755 /opt/sco/frontend/
### TMP FOLDER
cp /usr/lib/tmpfiles.d/fs-tmp.conf /etc/tmpfiles.d/
echo "D /tmp 1777 root root -" > /etc/tmpfiles.d/fs-tmp.conf
### SERVICE
find /opt/sco/resources/services/ -type f -exec sh -c 'cp "$1" "/etc/systemd/system/$(basename "$1")"' _ {} \;
find /opt/sco/resources/services/ -type f -exec sh -c 'systemctl enable "$(basename "$1")"' _ {} \;
systemctl daemon-reload
### AUTOSTART
rsync -a --delete /opt/sco/resources/autostart/ /home/sco/.config/autostart/
chown -R sco:users /home/sco/.config/autostart/*
chmod -R 644 /home/sco/.config/autostart/*
### CRONTAB
crontab -u root /opt/sco/resources/crontab/root.txt
crontab -u sco /opt/sco/resources/crontab/sco.txt
### PYTHON
find /opt/sco/resources/python/ -type d -iname "packages" | while read packages_dir; do
parent_dir=$(dirname "$packages_dir")
req_file="$parent_dir/requirements.txt"
if [ -f "$req_file" ]; then
pip install -q --no-index --find-links="$packages_dir" -r "$req_file"
fi
done
### DOCKER IMAGES
mkdir -p /tmp/images/
find /opt/sco/resources/images/ -type f -name '*.gz' -exec sh -c 'gunzip -c "$1" > /tmp/images/"$(basename "${1%.gz}")"' _ {} \;
find /tmp/images/ -type f -iname "*.tar" -exec docker load -i {} \;
### INIT CPI-SERVER DATABASES AND LOGS FOLDERS
mkdir -p /opt/sco/backend/docker/data/cpi-server/database
mkdir -p /opt/sco/backend/docker/data/cpi-server/logs/devices
mkdir -p /opt/sco/backend/docker/data/cpi-server/logs/service
touch /opt/sco/backend/docker/data/cpi-server/database/configuration.db
touch /opt/sco/backend/docker/data/cpi-server/database/connectivity.db
touch /opt/sco/backend/docker/data/cpi-server/database/Identity.db
touch /opt/sco/backend/docker/data/cpi-server/database/transaction.db
touch /opt/sco/backend/docker/data/cpi-server/database/trialdata.db
### INIT SYMETRIC CONFIGURATION FILE
mkdir -p /opt/sco/backend/docker/data/symmetric
if [ ! -f /opt/sco/backend/docker/data/symmetric/engine.properties ]; then
LOCAL_NODE=$(hostname)
LOCAL_IP=$(ip route get 1.1.1.1 | grep -oP '(?<=src\s)\d+(\.\d+){3}')
cat <<EOF > /opt/sco/backend/docker/data/symmetric/engine.properties
engine.name=$LOCAL_NODE
group.id=fullmesh
external.id=$LOCAL_NODE
db.driver=com.mysql.cj.jdbc.Driver
db.url=jdbc:mysql://$LOCAL_IP:3306/sco
db.user=root
db.password=U2qs&U6LA9U2
registration.url=
sync.url=http://$LOCAL_IP:31415/sync/$LOCAL_NODE
start.pulled.job=true
job.purge.period.time.ms=7200000
EOF
fi
+105
View File
@@ -0,0 +1,105 @@
#!/bin/sh
### DOWNLOAD MC
if [ ! -f /usr/local/bin/mc ]; then
curl -L https://dl.min.io/client/mc/release/linux-amd64/mc -o /usr/local/bin/mc
chmod +x /usr/local/bin/mc
fi
### VALIDATE PARAMETERS
SERVER=minio-api.laoficina1782.com
CUSTOMER="${1:?Uso: $0 <customer> <sucursal> <sco_number>}"
SUCURSAL="${2:?Uso: $0 <customer> <sucursal> <sco_number>}"
SCO_NUMBER="${3:?Uso: $0 <customer> <sucursal> <sco_number>}"
### STOP SERVICES
systemctl stop scovirtual.service
systemctl stop scoserver.service
systemctl stop scodocker.service
### UPDATE SOFTWARE
mc --config-dir /tmp/mc-config alias set minio "https://$SERVER" minioadmin LIGTNbUgQr
mc --config-dir /tmp/mc-config mirror --json --remove --overwrite --exclude "backend/docker/data/**" "minio/$CUSTOMER" /opt/sco/
find /opt/sco/ -type d -exec chmod 755 {} \;
find /opt/sco/ -type f -exec chmod 644 {} \;
chmod -R 755 /opt/sco/frontend/
### ENV FILE FOR MONITORING+REPORTING
cat <<EOF > /opt/sco/backend/docker/.env
SUCURSAL=$SUCURSAL
SCO_NUMBER=$SCO_NUMBER
SCO_CLIENT=$CUSTOMER
EOF
chmod 644 /opt/sco/backend/docker/.env
### SCO-AGENT DATA DIRS
mkdir -p /opt/sco/backend/docker/data/sco-agent/outbox
mkdir -p /opt/sco/backend/docker/data/sco-agent/state
mkdir -p /opt/sco/backend/docker/data/sco-agent/prom
chmod -R 777 /opt/sco/backend/docker/data/sco-agent/
### TMP FOLDER
cp /usr/lib/tmpfiles.d/fs-tmp.conf /etc/tmpfiles.d/
echo "D /tmp 1777 root root -" > /etc/tmpfiles.d/fs-tmp.conf
### SERVICE
find /opt/sco/resources/services/ -type f -exec sh -c 'cp "$1" "/etc/systemd/system/$(basename "$1")"' _ {} \;
find /opt/sco/resources/services/ -type f -exec sh -c 'systemctl enable "$(basename "$1")"' _ {} \;
systemctl daemon-reload
### AUTOSTART
rsync -a --delete /opt/sco/resources/autostart/ /home/sco/.config/autostart/
chown -R sco:users /home/sco/.config/autostart/*
chmod -R 644 /home/sco/.config/autostart/*
### CRONTAB
crontab -u root /opt/sco/resources/crontab/root.txt
crontab -u sco /opt/sco/resources/crontab/sco.txt
### PYTHON
find /opt/sco/resources/python/ -type d -iname "packages" | while read packages_dir; do
parent_dir=$(dirname "$packages_dir")
req_file="$parent_dir/requirements.txt"
if [ -f "$req_file" ]; then
pip install -q --no-index --find-links="$packages_dir" -r "$req_file"
fi
done
### DOCKER IMAGES
docker rmi -f $(docker images -aq)
mkdir -p /tmp/images/
find /opt/sco/resources/images/ -type f -name '*.gz' -exec sh -c 'gunzip -c "$1" > /tmp/images/"$(basename "${1%.gz}")"' _ {} \;
find /tmp/images/ -type f -iname "*.tar" -exec docker load -i {} \;
### INIT CPI-SERVER DATABASES AND LOGS FOLDERS
mkdir -p /opt/sco/backend/docker/data/cpi-server/database
mkdir -p /opt/sco/backend/docker/data/cpi-server/logs/devices
mkdir -p /opt/sco/backend/docker/data/cpi-server/logs/service
touch /opt/sco/backend/docker/data/cpi-server/database/configuration.db
touch /opt/sco/backend/docker/data/cpi-server/database/connectivity.db
touch /opt/sco/backend/docker/data/cpi-server/database/Identity.db
touch /opt/sco/backend/docker/data/cpi-server/database/transaction.db
touch /opt/sco/backend/docker/data/cpi-server/database/trialdata.db
### INIT SYMETRIC CONFIGURATION FILE
mkdir -p /opt/sco/backend/docker/data/symmetric
if [ ! -f /opt/sco/backend/docker/data/symmetric/engine.properties ]; then
LOCAL_NODE=$(hostname)
LOCAL_IP=$(ip route get 1.1.1.1 | grep -oP '(?<=src\s)\d+(\.\d+){3}')
cat <<EOF > /opt/sco/backend/docker/data/symmetric/engine.properties
engine.name=$LOCAL_NODE
group.id=fullmesh
external.id=$LOCAL_NODE
db.driver=com.mysql.cj.jdbc.Driver
db.url=jdbc:mysql://$LOCAL_IP:3306/sco
db.user=root
db.password=U2qs&U6LA9U2
registration.url=
sync.url=http://$LOCAL_IP:31415/sync/$LOCAL_NODE
start.pulled.job=true
job.purge.period.time.ms=7200000
EOF
fi
### REBOOT
nohup sh -c 'sleep 5; shutdown -r now' >/dev/null 2>&1 &
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
set -e
if ! docker ps --format '{{.Names}}' | grep -qx sco-agent; then
echo "El contenedor sco-agent no esta corriendo en este equipo" >&2
exit 1
fi
docker exec sco-agent python -m sco_agent.history
+617
View File
@@ -0,0 +1,617 @@
jenkins:
numExecutors: 2
nodeMonitors:
- "architecture"
- "clock"
- diskSpace:
freeSpaceThreshold: "0"
freeSpaceWarningThreshold: "0"
- "swapSpace"
- tmpSpace:
freeSpaceThreshold: "0"
freeSpaceWarningThreshold: "0"
- "responseTime"
authorizationStrategy:
loggedInUsersCanDoAnything:
allowAnonymousRead: false
securityRealm:
local:
allowsSignup: false
users:
- id: admin
password: H0l4mund0!
# Agentes permanentes (WebSocket): cada SCO conecta outbound a Jenkins via wss://.
# El deploy (Jenkinsfile.sco) targetea por nombre exacto de nodo (parámetro NODO),
# no por label, por eso los nodos no llevan labelString.
nodes:
- permanent:
name: "ralph-caguas-sco04"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-caguas-sco05"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-caguas-sco06"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-caguas-sco07"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-caguas-sco08"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-caguas-sco09"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-cayey-sco01"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-cayey-sco02"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-cayey-sco03"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-cayey-sco04"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-deleste-humacao-sco01"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-deleste-humacao-sco02"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-fajardo-sco07"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-fajardo-sco08"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-fajardo-sco09"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-fajardo-sco10"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-fajardo-sco11"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-fajardo-sco12"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-gurabo-sco03"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-gurabo-sco04"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-gurabo-sco05"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-gurabo-sco06"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-humacao-sco07"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-humacao-sco08"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-humacao-sco09"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-humacao-sco10"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-humacao-sco11"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-humacao-sco12"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-juntos-sco04"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-juntos-sco05"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-juntos-sco06"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-juntos-sco07"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-las-piedras-sco08"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-las-piedras-sco09"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-las-piedras-sco10"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-las-piedras-sco11"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-las-piedras-sco12"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-montehiedra-sco13"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-montehiedra-sco14"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-montehiedra-sco15"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-montehiedra-sco16"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-montehiedra-sco17"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-montehiedra-sco18"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-montehiedra-sco19"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-montehiedra-sco20"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-naguabo-sco04"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-naguabo-sco05"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-naguabo-sco06"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-naguabo-sco07"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-yabucoa-sco02"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-yabucoa-sco03"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-yabucoa-sco04"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-yabucoa-sco05"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-yabucoa-sco06"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-yabucoa-sco07"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-san-lorenzo-sco03"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-san-lorenzo-sco04"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-san-lorenzo-sco05"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-san-lorenzo-sco06"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-rio-grande-sco01"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-rio-grande-sco02"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-rio-grande-sco03"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-rio-grande-sco04"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-rio-grande-sco05"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "ralph-rio-grande-sco06"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "laboratorio-girboy-sco81"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "laboratorio-girboy-sco82"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "laboratorio-girboy-sco83"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
- permanent:
name: "hisense-santiago-sco01"
remoteFS: "/opt/jenkins-agent"
numExecutors: 1
retentionStrategy: "always"
launcher:
inbound:
webSocket: true
unclassified:
location:
url: https://jenkins.laoficina1782.com/
security:
globalJobDslSecurityConfiguration:
useScriptSecurity: false
jobs:
- script: |
pipelineJob('deploy-sco') {
description('Deploy de install.sh a un nodo SCO puntual, para el cliente seleccionado.')
definition {
cps {
script(new File('/opt/jenkins/Jenkinsfile.sco').text)
sandbox(true)
}
}
}
- script: |
pipelineJob('deploy-sco-reports') {
description('Deploy de install.sh.reports a un nodo SCO puntual, para el cliente+sucursal+sco seleccionado.')
definition {
cps {
script(new File('/opt/jenkins/Jenkinsfile.sco.reports').text)
sandbox(true)
}
}
}
- script: |
pipelineJob('history-sco') {
description('Reprocesa el historial de logs de un nodo SCO puntual via sco-agent.')
definition {
cps {
script(new File('/opt/jenkins/Jenkinsfile.sco.reports.history').text)
sandbox(true)
}
}
}
+70
View File
@@ -0,0 +1,70 @@
pipeline {
agent none
parameters {
string(
name: 'NODO',
defaultValue: '',
description: 'Nombre exacto del nodo a deployar'
)
choice(
name: 'CLIENTE',
choices: [
'SELECCIONAR_CLIENTE',
'cencosud-jumbo',
'censosud-staisabel',
'changomas-hiper',
'changomas-super',
'dibal',
'hisense',
'lsco',
'mbs-econo',
'mbs-famcoop',
'mbs-ralphs',
'mbs-supermax',
'modatelas',
'walmart-chile-acuenta',
'walmart-chile-lider',
'wm-mexico-bodega',
'wm-mexico-walmart'
],
description: 'Cliente para el cual se ejecuta el deploy'
)
}
stages {
stage('Registro de parámetros') {
agent none
when { expression { params.CLIENTE == null } }
steps {
echo 'Primer build: Jenkins está registrando los parámetros de este Jenkinsfile. No se ejecuta ningún deploy. Volvé a correr el job con "Build with Parameters".'
script { currentBuild.result = 'NOT_BUILT' }
}
}
stage('Preparar scripts') {
agent { label 'built-in' }
when { expression { params.CLIENTE != null } }
steps {
sh 'cp /opt/deploy/install.sh .'
stash name: 'scripts', includes: 'install.sh'
}
}
stage('Deploy') {
agent { label 'built-in' }
when { expression { params.CLIENTE != null } }
steps {
script {
if (!params.NODO?.trim()) {
error "El parámetro NODO es obligatorio"
}
if (params.CLIENTE == 'SELECCIONAR_CLIENTE') {
error "El parámetro CLIENTE es obligatorio"
}
def target = params.NODO.trim()
node(target) {
unstash 'scripts'
sh "bash install.sh '${params.CLIENTE.trim()}'"
}
}
}
}
}
}
@@ -0,0 +1,80 @@
pipeline {
agent none
parameters {
string(
name: 'NODO',
defaultValue: '',
description: 'Nombre exacto del nodo a deployar'
)
choice(
name: 'CLIENTE',
choices: [
'SELECCIONAR_CLIENTE',
'cencosud-jumbo',
'censosud-staisabel',
'changomas-hiper',
'changomas-super',
'dibal',
'hisense',
'lsco',
'mbs-econo',
'mbs-famcoop',
'mbs-ralphs',
'mbs-supermax',
'modatelas',
'walmart-chile-acuenta',
'walmart-chile-lider',
'wm-mexico-bodega',
'wm-mexico-walmart'
],
description: 'Cliente para el cual se ejecuta el deploy'
)
string(
name: 'SUCURSAL',
defaultValue: '',
description: 'Sucursal del equipo'
)
string(
name: 'SCO_NUMBER',
defaultValue: '',
description: 'Número de SCO (ej. sco05)'
)
}
stages {
stage('Registro de parámetros') {
agent none
when { expression { params.CLIENTE == null } }
steps {
echo 'Primer build: Jenkins está registrando los parámetros de este Jenkinsfile. No se ejecuta ningún deploy. Volvé a correr el job con "Build with Parameters".'
script { currentBuild.result = 'NOT_BUILT' }
}
}
stage('Preparar scripts') {
agent { label 'built-in' }
when { expression { params.CLIENTE != null } }
steps {
sh 'cp /opt/deploy/install.sh.reports .'
stash name: 'scripts', includes: 'install.sh.reports'
}
}
stage('Deploy') {
agent { label 'built-in' }
when { expression { params.CLIENTE != null } }
steps {
script {
if (!params.NODO?.trim()) {
error "El parámetro NODO es obligatorio"
}
if (params.CLIENTE == 'SELECCIONAR_CLIENTE') {
error "El parámetro CLIENTE es obligatorio"
}
def target = params.NODO.trim()
node(target) {
unstash 'scripts'
sh "bash install.sh.reports '${params.CLIENTE.trim()}' '${params.SUCURSAL.trim()}' '${params.SCO_NUMBER.trim()}'"
}
}
}
}
}
}
@@ -0,0 +1,44 @@
pipeline {
agent none
parameters {
string(name: 'NODO', defaultValue: '', description: 'Nombre exacto del agente SCO (ej: ralph-yabucoa-sco05)')
}
stages {
stage('Registro de parámetros') {
agent none
when { expression { params.NODO == null } }
steps {
echo 'Primer build: Jenkins está registrando los parámetros de este Jenkinsfile. No se ejecuta nada. Volvé a correr el job con "Build with Parameters".'
script { currentBuild.result = 'NOT_BUILT' }
}
}
stage('Preparar scripts') {
agent { label 'built-in' }
when { expression { params.NODO != null } }
steps {
sh 'cp /opt/history/history.sh .'
stash name: 'scripts', includes: 'history.sh'
}
}
stage('Reprocesar historial') {
agent { label 'built-in' }
when { expression { params.NODO != null } }
steps {
script {
if (!params.NODO?.trim()) {
error "El parámetro NODO es obligatorio"
}
def target = params.NODO.trim()
node(target) {
unstash 'scripts'
timeout(time: 30, unit: 'MINUTES') {
sh 'bash history.sh'
}
}
}
}
}
}
}