big jenkinsifile update

This commit is contained in:
2025-10-12 16:48:52 -07:00
parent 40a8253229
commit 22b4ef4336
26 changed files with 148 additions and 54 deletions

View File

@ -10,6 +10,10 @@ pipeline {
booleanParam(name: 'onboard_pi', defaultValue: false, description: 'Check this option to onboard a new FriendlyElec Device')
booleanParam(name: 'GUI_deploy', defaultValue: false, description: 'Check this option to set up GUI if possible')
booleanParam(name: 'jellyfin_deploy', defaultValue: false, description: 'Check this option to install Jellyfin')
booleanParam(name: 'luna_offload', defaultValue: false, description: 'Check this option to offload MediaMTX to luna.cosmos')
booleanParam(name: 'kiosk_refresh', defaultValue: false, description: 'Check this option to only refresh the chrome kiosk')
booleanParam(name: 'remote_deploy', defaultValue: false, description: 'Deploy as low-power transmit only node.')
booleanParam(name: 'server_deploy', defaultValue: false, description: 'Deploy as server to receive from remote deploy node')
booleanParam(name: 'extra_storage', defaultValue: false, description: 'Check this option to automatically configure the secondary storage. Be careful.')
}
@ -85,14 +89,15 @@ pipeline {
}
}
stage('Generate Inventory File') {
steps {
// Generate the dynamic inventory file
sh """
jenkins_group=\$(echo ${env.BUILD_USER_GROUPS} | sed 's/,/\\n/g' | grep Jenkins | head -n 1)
jenkins_user=\$(echo ${env.BUILD_USER})
cd /var/jenkins_home/ansible
chmod +x /var/jenkins_home/ansible/inventory/inventory.sh
/var/jenkins_home/ansible/inventory/inventory.sh ${params.host_ip}
/var/jenkins_home/ansible/inventory/inventory.sh -g \$jenkins_group -u \$jenkins_user -i ${params.host_ip}
"""
}
@ -100,8 +105,6 @@ pipeline {
stage('Ansible Playbook') {
steps {
//Run the VCR-captute ansible playbook
// /workspace/ansible/playbooks/cosmos-base.yaml
sh """
echo ${params.host_ip}
hash=\$(echo -n ${params.host_ip} | md5sum | cut -c 1-8)
@ -111,13 +114,15 @@ pipeline {
ansible-playbook -i \$inventory_file \
/var/jenkins_home/ansible/playbooks/VCR-capture.yaml --ssh-common-args='-o StrictHostKeyChecking=no' \
--extra-vars "docker_full=false no_vpn=true add_domain=false \
--extra-vars "docker_full=false no_vpn=true add_domain=false \
matt_public_key='${env.matt_public_key}' matt_private_key='${env.matt_private_key}' \
cosmos_password='${env.cosmos_password}' cosmos_root_password='${env.cosmos_root_password}' \
new_hostname=${params.new_hostname} refresh_special=${params.refresh_special} \
rename_host=${params.rename_endpoint} onboard_pi=${params.onboard_pi} \
public_deploy=${params.public_deploy} jellyfin_deploy=${params.jellyfin_deploy} \
GUI_deploy=${params.GUI_deploy} extra_storage=${params.extra_storage} "
GUI_deploy=${params.GUI_deploy} extra_storage=${params.extra_storage} \
luna_offload=${params.luna_offload} kiosk_refresh=${params.kiosk_refresh} \
remote_deploy=${params.remote_deploy} server_deploy=${params.server_deploy}"
"""
}