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

@ -8,7 +8,6 @@ pipeline {
booleanParam(name: 'rename_endpoint', defaultValue: true, description: 'Uncheck to skip renaming of endpoint')
booleanParam(name: 'add_domain', defaultValue: true, description: 'When checked hostname will have home.cosmos appended')
booleanParam(name: 'install_docker', defaultValue: true, description: 'When checked docker packages are installed and portainer started on 9100')
booleanParam(name: 'public_deploy', defaultValue: true, description: 'Uncheck this option to deploy private SSH key')
booleanParam(name: 'onboard_pi', defaultValue: false, description: 'Check this option to onboard a new FriendlyElec Device')
booleanParam(name: 'install_python', defaultValue: false, description: 'Check this option to install python packages')
booleanParam(name: 'refresh_special', defaultValue: false, description: 'When checked the autologin account and kiosk are refreshed only')
@ -97,9 +96,12 @@ pipeline {
// Also create the kiosk variable yaml with hash value
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}
hash=\$(echo -n "${params.host_ip}" | md5sum | cut -c 1-8)
kiosk_yaml=/var/jenkins_home/ansible/roles/chrome_kiosk/files/kiosk-\$hash.yaml
@ -130,14 +132,14 @@ pipeline {
ansible-playbook -i \$inventory_file \
/var/jenkins_home/ansible/playbooks/cosmos-kiosk.yaml --ssh-common-args='-o StrictHostKeyChecking=no' \
--extra-vars "docker_full=false no_vpn=true jenkins_kiosk=true \
--extra-vars "docker_full=false no_vpn=true jenkins_kiosk=true public_deploy=true \
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} public_deploy=${params.public_deploy} \
new_hostname=${params.new_hostname} force_x11=${params.force_x11} \
rename_host=${params.rename_endpoint} onboard_pi=${params.onboard_pi} \
add_domain=${params.add_domain} install_docker=${params.install_docker} \
install_python=${params.install_python} refresh_special=${params.refresh_special} \
force_x11=${params.force_x11} kiosk_yaml='\$kiosk_yaml'"
kiosk_yaml='\$kiosk_yaml'"
"""
}