# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 PortSystem 1.0 PortGroup java 1.0 name jenkins version 2.440.2 revision 0 categories devel java maintainers {gmail.com:slashapp @slashapp} openmaintainer homepage https://jenkins.io description The leading open source automation server,\ Jenkins provides hundreds of plugins to support building,\ deploying and automating any project. long_description ${description} platforms {darwin any} supported_archs noarch license MIT master_sites https://get.jenkins.io/war-stable/${version}/ dist_subdir ${name}/${version} set jenkins_war ${name}.war distfiles ${jenkins_war} checksums rmd160 3fa354cfc3244dc612f02deaa4062ff5349c212a \ sha256 8126628e9e2f8ee2f807d489ec0a6e37fc9f5d6ba84fa8f3718e7f3e2a27312e \ size 86482142 java.version 11+ java.fallback openjdk11 use_configure no extract {} build {} test {} set jenkins_wrapper ${prefix}/etc/LaunchDaemons/org.macports.${name}/${name}.wrapper set jenkins_exec_dir ${prefix}/libexec/${name} set jenkins_home_dir ${prefix}/var/lib/${name} set jenkins_log_dir ${prefix}/var/log/${name} set jenkins_run_dir ${prefix}/var/run/${name} set jenkins_exec ${jenkins_exec_dir}/${jenkins_war} set jenkins_log ${jenkins_log_dir}/${name}.log set jenkins_pid ${jenkins_run_dir}/${name}.pid set jenkins_host 127.0.0.1 set jenkins_port 8080 set jenkins_user jenkins set jenkins_group jenkins set jenkins_dir_list [list \ ${jenkins_exec_dir} \ ${jenkins_home_dir} \ ${jenkins_log_dir} \ ${jenkins_run_dir} \ ] set jenkins_exec_list [list \ ${distpath}/${jenkins_war} ] foreach d ${jenkins_dir_list} { destroot.keepdirs-append \ ${destroot}${d} } destroot { foreach d ${jenkins_dir_list} { xinstall -d -m 0755 -g ${jenkins_group} -o ${jenkins_user} \ ${destroot}${d} } foreach f ${jenkins_exec_list} { xinstall -m 0644 -g ${jenkins_group} -o ${jenkins_user} \ ${f} \ ${destroot}${jenkins_exec_dir} } } post-deactivate { # Cleanup all Jenkins-created files, which are significant foreach d ${jenkins_dir_list} { if {${d} eq ${jenkins_home_dir}} { if { [file exists "${d}/.jenkins" ]} { ui_msg "********************************************************" ui_msg "To revert the system after uninstalling the port," ui_msg "delete jenkins working directory:" ui_msg "$ sudo rm -fr ${jenkins_home_dir}" ui_msg "********************************************************" continue } } if { [file exists ${d}] } { ui_info "post-deactivate: dir exists, deleting: ${d}" delete -force ${d} } else { ui_info "post-deactivate: dir doesn't exist, skipping delete: ${d}" } } } add_users ${jenkins_user} \ group=${jenkins_group} \ home=${jenkins_home_dir} \ shell=/bin/sh \ realname=Jenkins startupitem.create yes # Enable additional logging, for diagnostic purposes startupitem.logevents yes startupitem.user ${jenkins_user} startupitem.group ${jenkins_group} # Note: To avoid breakage when a Java port is updated/removed, use 'java_home' to select at runtime # java_home version filter not support wildcards set java_version [regsub {[^0-9.]} ${java.version} ""] startupitem.init " export JAVA_HOME=\$(/usr/libexec/java_home --failfast --version ${java_version} 2>/dev/null || /usr/libexec/java_home) " startupitem.start \ "\${JAVA_HOME}/bin/java \ -Duser.home=${jenkins_home_dir} \ -jar ${jenkins_exec} \ --httpListenAddress=${jenkins_host} \ --httpPort=${jenkins_port}" startupitem.stop \ "kill \$(cat ${jenkins_pid})" startupitem.logfile \ ${jenkins_log} startupitem.pidfile \ manual ${jenkins_pid} notes-append " To configure the Jenkins service, edit parameters as follows: - Read document at https://jenkins.io/doc/book/installing/initial-settings/ - \$ sudo vi ${jenkins_wrapper} Once the service is enabled, Jenkins will: - Listen by default on: http://${jenkins_host}:${jenkins_port} The default Administrator password, created after port first loaded, will be available here: - \$ sudo cat ${jenkins_home_dir}/.jenkins/secrets/initialAdminPassword " livecheck.url "https://www.jenkins.io/download/" livecheck.regex {war-stable/([0-9.]+)/jenkins}