From owner-freebsd-java@freebsd.org Sun Jan 10 19:00:33 2016 Return-Path: Delivered-To: freebsd-java@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 393DEA6AFA4; Sun, 10 Jan 2016 19:00:33 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01C4F1AE6; Sun, 10 Jan 2016 19:00:33 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: by mail-ig0-x22b.google.com with SMTP id z14so88084965igp.1; Sun, 10 Jan 2016 11:00:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:cc:content-type; bh=ML5gTmFyCUBZvPzHdlab2Ebtmb66QLBEV9leHBeINCE=; b=Gqvr5z87+lEGzX9eu7rGVLPTecAspUmUa3Xo9HWK4vgQqRAfhuV4wnjlZo6LWaGuAf 0JiUa6f9z6Sh9A6DJ1rIJ2/PiKgknIevnPTu53E7oIZrGR4HHROjZbB9Zeb+upww4pE0 tK1nTJ7vQD+9ve7Knq2GeMC1DZ4mC5QaUPxYl/E5rJ1fnfEM6gtjKDT4+ubBz2H3wFV9 /oL95xWPznsrr3aqSFeP2tMcmL3PHFPFoisZhx1ewcxTrcWTs51r9rtU8YWAYgt23T+U pCGVLocRRCPKMCrMDwLdMK8uws4VjOnV9jlghstG5OHH8HK93x0X0sXq8Gykw8u9JDWM NtSA== MIME-Version: 1.0 X-Received: by 10.50.147.73 with SMTP id ti9mr7828786igb.36.1452452432407; Sun, 10 Jan 2016 11:00:32 -0800 (PST) Sender: crodr001@gmail.com Received: by 10.50.152.69 with HTTP; Sun, 10 Jan 2016 11:00:32 -0800 (PST) Date: Sun, 10 Jan 2016 14:00:32 -0500 X-Google-Sender-Auth: NL_sM9nfK5UL0haWbb1G2txITkY Message-ID: Subject: Need Groovy help for Jenkins script to build/run/test FreeBSD image From: Craig Rodrigues To: "freebsd-testing@freebsd.org" Cc: "freebsd-java@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2016 19:00:33 -0000 Hi, I am making some serious efforts to convert my existing Jenkins jobs to use the Jenkins workflow plugin, because that is what the developers who work on Jenkins are moving towards. The Jenkins workflow plugin, which has a small Groovy-based Domain Specific Language (DSL): https://github.com/jenkinsci/workflow-plugin#getting-started My first attempt is here: https://github.com/freebsd/freebsd-ci/blob/master/scripts/build/build-test.groovy The script calls several helper scripts, but overall what it is trying to do is: 1. Builds the FreeBSD src tree. 2. Run the Warnings plugin over the compiler output to detect warnings 3. Creates a VM disk image which can boot in bhyve. 4. Boots the VM disk image in bhyve 5. Runs the FreeBSD test suite in the VM 6. Take the JUnit test output and add it to the test report viewer Sample output from this script which builds FreeBSD_HEAD is here: https://jenkins.freebsd.org/job/FreeBSD_HEAD/40/flowGraphTable/ This is my first attempt at writing Groovy. I looked at http://groovy-lang.org to get some basic ideas. Can someone point me to good books or tutorials for learning Groovy? Also, can someone review my script and provide feedback, on any obvious things I have done wrong, or any possible ways to optimize it? Providing feedback via this e-mail thread or on GitHub is fine. Thanks. -- Craig