SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Downloaden Sie, um offline zu lesen
Lightweight
Developer
Provisioning with
Gradle
and SEU-as-code
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 1
About me
Mario-Leander Reimer
Chief Technologist, QAware GmbH
mario-leander.reimer@qaware.de
twitter://@LeanderReimer
http://speakerdeck.com/lreimer
http://github.com/lreimer
http://github.com/seu-as-code
http://seu-as-code.io
http://www.qaware.de
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 2
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 3
SEU: a German acronym;
software development environment
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 4
Definition of Software Industrialization
• This has nothing to do with cheap labor!
• Automation of repetitive and laborious tasks
• Better software quality through standardized,
streamlined tooling
• Well integrated tool chain leads to a higher
productivity and happiness of your team
• Better cost efficiency and competitiveness
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 5
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 6
The ideal.
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 7
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 8
The reality?
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 9
What are the problems?
• Manual and error prone creation and update
procedure of individual SEUs
• Individual SEUs produce different results and
strange bugs
• Old versions of a SEU can't easily be restored
• The SEU for a new project is often a copy of a
previous project. ! Broken windows! !
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 10
The solution ...
• Use a build tool for the automated creation and
update of a SEU
• Software packages are expressed as dependencies
• Gradle tasks and Groovy are used instead of
shell scripting
• Everything is version controlled just like
ordinary source code
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 11
Demo.
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 12
The most minimalistic SEU
plugins {
id 'de.qaware.seu.as.code.base' version '2.4.0'
}
seuAsCode {
seuHome = 'J:'
projectName = 'JavaOne 2016'
}
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 13
Multi platform SEUs for mixed teams
plugins {
id 'de.qaware.seu.as.code.base' version '2.4.0'
}
import static de.qaware.seu.as.code.plugins.base.Platform.isMac
seuAsCode {
// use closure or Elvis operator (no syntax highlighting :(
seuHome = { if (isMac()) '/Volumes/JavaOne-2016' else 'J:' }
projectName = 'JavaOne 2016'
}
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 14
Software packages are dependencies
• Gradle has built-in support for dependencies
• Gradle supports different artifact repositories
(Maven, Ivy, Directory)
• Transitive dependencies between software
packages are supported
• Use dependency configurations to determine
installation directory
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 15
Software dependencies and configurations
repositories {
maven { url 'https://dl.bintray.com/seu-as-code/maven' }
jcenter()
}
dependencies {
seuac 'org.codehaus.groovy.modules.scriptom:scriptom:1.6.0'
seuac 'com.h2database:h2:1.4.188'
home 'de.qaware.seu.as.code:seuac-home:2.4.0'
software 'de.qaware.seu.as.code:seuac-environment:2.4.0:jdk8'
software 'org.gradle:gradle:2.14.1'
software "net.java:openjdk8:8u40:$osClassifier"
}
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 16
Secure passwords with Credentials plugin
plugins { id 'de.qaware.seu.as.code.credentials' version '2.4.0' }
repositories {
maven {
url 'https://your.company.com/nexus/repo'
credentials {
// access stored credentials via extra property
username project.credentials['Nexus'].username
password project.credentials['Nexus'].password
}
}
}
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 17
Platform plugin for OS specific builds
plugins { id 'de.qaware.seu.as.code.platform' version '1.0.0' }
platform {
win {
task helloSeuAsCode(group: 'Example') << {
println 'Hello SEU-as-code on Windows.'
}
}
mac {
task helloSeuAsCode(group: 'Example') << {
println 'Hello SEU-as-code on MacOS.'
}
}
}
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 18
Manage sources with Git or SVN plugin
plugins {
id 'de.qaware.seu.as.code.credentials' version '2.4.0'
id 'de.qaware.seu.as.code.git' version '2.3.0'
}
git {
plugins {
url 'https://github.com/seu-as-code/seu-as-code.plugins.git'
directory file("$seuHome/codebase/plugins/")
username project.credentials['Github'].username
password project.credentials['Github'].password
}
}
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 19
Manage sources with Git or SVN plugin
plugins {
id 'de.qaware.seu.as.code.credentials' version '2.4.0'
id 'de.qaware.seu.as.code.svn' version '2.1.1'
}
subversion {
usersGuide {
url 'https://github.com/seu-as-code/seu-as-code.users-guide.git'
directory file("$seuHome/docbase/users-guide/")
username project.credentials['Subversion'].username
password project.credentials['Subversion'].password
}
}
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 20
Implement scripts using plain Gradle
• Gradle build scripts are code! Be creative.
• Gradle provides useful predefined tasks: Copy,
Exec, Sync, Delete, ...
• Gradle tasks can easily reuse Ant tasks.
• Gradle tasks can be implemented in Groovy code.
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 21
Example 1: Init and delete Derby DB
ext.derbyHome = System.env['DERBY_HOME']
// import SQL file via the provided Derby command line tool
task initDemoDb(type: Exec, group: 'Database') {
workingDir "$derbyHome/bin"
commandLine 'cmd', '/B', '/C', 'ij.bat', "$rootDir/scripts/init.sql"
}
task deleteDemoDb(type: Delete, group: 'Database') {
delete "$derbyHome/demo"
}
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 22
Example 1: The Groovy SQL way
import groovy.sql.*
task initDemoDb(group: 'Database') << {
def derby = [
url: 'jdbc:derby://localhost:1527/demo;create=true',
driver: 'org.apache.derby.jdbc.ClientDriver',
user: 'admin',
password: 'secret'
]
Sql.withInstance(derby) {
execute file("$rootDir/scripts/database/init.sql").text
}
}
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 23
Example 2: Restore Solr index data
ext.cores = ['de_DE', 'en_GB', 'zh_CN']
task solrRestoreAll(group: 'Solr') { }
cores.each { coreName ->
def name = coreName.replaceAll("_", "").capitalize()
task "solrRestore${name}"(type: Sync, group: 'Solr') {
from zipTree("$rootDir/scripts/solr/${coreName}.zip")
into "$seuHome/software/solr-4.7.2/example/solr/${coreName}"
}
solrRestoreAll.dependsOn "solrRestore${name}"
}
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 24
Don't use shell
scripts. Use
Gradle instead!
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 25
Building software packages is easy
• Software packages are essentially plain JAR
files (software + customizations)
• 26 packages available via a Bintray repository
https://bintray.com/seu-as-code/maven
• 44 package build blue-prints are available at
Github, continuously growing.
• Software packages can be build with Gradle!
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 26
Let's build our
first package
using Gradle!
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 27
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 28
Download the original binary distribution
plugins {
id 'de.undercouch.download' version '1.2'
}
import de.undercouch.gradle.tasks.download.Download
task downloadArchive(type: Download) {
src 'https://services.gradle.org/distributions/gradle-3.0-all.zip'
dest "$buildDir"
}
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 29
Unpack archive using simple Gradle task
task extractArchive(type: Copy, dependsOn: downloadArchive) {
from {
zipTree("$buildDir/${project.name}-${version}-all.zip")
}
into "$buildDir/files"
}
// Best practice: directory name matches the package name
// optionally rename the extracted directory if required
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 30
Customize with additional files and hooks
// plain Groovy, place as a file under META-INF/hooks/
import org.codehaus.groovy.scriptom.*
Scriptom.inApartment
{
def wshShell = new ActiveXObject("WScript.Shell")
def shortcut = wshShell.CreateShortcut("$seuHomegradle.lnk")
shortcut.TargetPath = "${seuLayout.software}go-gradle.bat"
shortcut.WorkingDirectory = "${seuLayout.codebase}"
shortcut.Save()
}
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 31
Repackage all files as a normal JAR file
task buildPackage(type: Jar, dependsOn: extractArchive) {
baseName project.name
version version
extension 'jar'
// classifier 'x86'
destinationDir buildDir
from "$buildDir/files" // the extracted files
from "files" // some extra files
}
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 32
Publish JAR artifact to a repository server
publishing {
publications {
gradle(MavenPublication) {
artifact "${buildDir}/${project.name}-${version}.jar"
}
}
repositories {
maven {
// alternatively, use your private company repository server
url 'https://bintray.com/seu-as-code/maven'
credentials { ... }
}
}
}
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 33
What's next?
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 34
More features to come ...
• Continuously add more software packages
• Create plugin to build software packages
• Support for self-downloading packages
• Add support for other package managers
• Add Vault support for Credentials plugin
• Improve documentation and user’s guide
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 35
Star SEU-as-code on Github!
$ git clone https://github.com/seu-as-code/seu-as-code.archetype.git
$ git clone https://github.com/seu-as-code/seu-as-code.plugins.git
$ git clone https://github.com/seu-as-code/seu-as-code.packages.git
$ git clone https://github.com/seu-as-code/seu-as-code.examples.git
$ git clone https://github.com/seu-as-code/seu-as-code.documentation.git
$ git clone https://github.com/seu-as-code/seu-as-code.users-guide.git
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 36
Q & A
| JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 37

Weitere ähnliche Inhalte

Was ist angesagt?

Escaping the Sandbox Denver HTML5 2013-05-13
Escaping the Sandbox Denver HTML5 2013-05-13Escaping the Sandbox Denver HTML5 2013-05-13
Escaping the Sandbox Denver HTML5 2013-05-13
michaelmalak
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And Tricks
Mike Hugo
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
Fred Sauer
 

Was ist angesagt? (19)

0900 learning-react
0900 learning-react0900 learning-react
0900 learning-react
 
react.pdf
react.pdfreact.pdf
react.pdf
 
Scala and Play with Gradle
Scala and Play with GradleScala and Play with Gradle
Scala and Play with Gradle
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
 
Gradle - time for another build
Gradle - time for another buildGradle - time for another build
Gradle - time for another build
 
Escaping the Sandbox Denver HTML5 2013-05-13
Escaping the Sandbox Denver HTML5 2013-05-13Escaping the Sandbox Denver HTML5 2013-05-13
Escaping the Sandbox Denver HTML5 2013-05-13
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolved
 
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
 
Hands on the Gradle
Hands on the GradleHands on the Gradle
Hands on the Gradle
 
Gradle : An introduction
Gradle : An introduction Gradle : An introduction
Gradle : An introduction
 
Gradle plugins, take it to the next level
Gradle plugins, take it to the next levelGradle plugins, take it to the next level
Gradle plugins, take it to the next level
 
Gradle plugin, take control of the build
Gradle plugin, take control of the buildGradle plugin, take control of the build
Gradle plugin, take control of the build
 
Gradle: The Build System you have been waiting for!
Gradle: The Build System you have been waiting for!Gradle: The Build System you have been waiting for!
Gradle: The Build System you have been waiting for!
 
Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And Tricks
 
Gradle For Beginners (Serbian Developer Conference 2013 english)
Gradle For Beginners (Serbian Developer Conference 2013 english)Gradle For Beginners (Serbian Developer Conference 2013 english)
Gradle For Beginners (Serbian Developer Conference 2013 english)
 
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
EWD 3 Training Course Part 41: Building a React.js application with QEWD, Part 5
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
 
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務
 

Andere mochten auch

Secure Architecture and Programming 101
Secure Architecture and Programming 101Secure Architecture and Programming 101
Secure Architecture and Programming 101
QAware GmbH
 

Andere mochten auch (20)

JEE on DC/OS - MesosCon Europe
JEE on DC/OS - MesosCon EuropeJEE on DC/OS - MesosCon Europe
JEE on DC/OS - MesosCon Europe
 
Microservices @ Work - A Practice Report of Developing Microservices
Microservices @ Work - A Practice Report of Developing MicroservicesMicroservices @ Work - A Practice Report of Developing Microservices
Microservices @ Work - A Practice Report of Developing Microservices
 
Automotive Information Research driven by Apache Solr
Automotive Information Research driven by Apache SolrAutomotive Information Research driven by Apache Solr
Automotive Information Research driven by Apache Solr
 
Leveraging the Power of Solr with Spark
Leveraging the Power of Solr with SparkLeveraging the Power of Solr with Spark
Leveraging the Power of Solr with Spark
 
Secure Architecture and Programming 101
Secure Architecture and Programming 101Secure Architecture and Programming 101
Secure Architecture and Programming 101
 
Der Cloud Native Stack in a Nutshell
Der Cloud Native Stack in a NutshellDer Cloud Native Stack in a Nutshell
Der Cloud Native Stack in a Nutshell
 
Per Anhalter durch den Cloud Native Stack (extended edition)
Per Anhalter durch den Cloud Native Stack (extended edition)Per Anhalter durch den Cloud Native Stack (extended edition)
Per Anhalter durch den Cloud Native Stack (extended edition)
 
Automotive Information Research driven by Apache Solr
Automotive Information Research driven by Apache SolrAutomotive Information Research driven by Apache Solr
Automotive Information Research driven by Apache Solr
 
Vamp - The anti-fragilitiy platform for digital services
Vamp - The anti-fragilitiy platform for digital servicesVamp - The anti-fragilitiy platform for digital services
Vamp - The anti-fragilitiy platform for digital services
 
Azure Functions - Get rid of your servers, use functions!
Azure Functions - Get rid of your servers, use functions!Azure Functions - Get rid of your servers, use functions!
Azure Functions - Get rid of your servers, use functions!
 
A Hitchhiker's Guide to the Cloud Native Stack
A Hitchhiker's Guide to the Cloud Native StackA Hitchhiker's Guide to the Cloud Native Stack
A Hitchhiker's Guide to the Cloud Native Stack
 
Developing Skills for Amazon Echo
Developing Skills for Amazon EchoDeveloping Skills for Amazon Echo
Developing Skills for Amazon Echo
 
Chronix as Long-Term Storage for Prometheus
Chronix as Long-Term Storage for PrometheusChronix as Long-Term Storage for Prometheus
Chronix as Long-Term Storage for Prometheus
 
Everything-as-code. Polyglotte Software-Entwicklung in der Praxis.
Everything-as-code. Polyglotte Software-Entwicklung in der Praxis.Everything-as-code. Polyglotte Software-Entwicklung in der Praxis.
Everything-as-code. Polyglotte Software-Entwicklung in der Praxis.
 
Kubernetes 101 and Fun
Kubernetes 101 and FunKubernetes 101 and Fun
Kubernetes 101 and Fun
 
Hands-on K8s: Deployments, Pods and Fun
Hands-on K8s: Deployments, Pods and FunHands-on K8s: Deployments, Pods and Fun
Hands-on K8s: Deployments, Pods and Fun
 
Cloud Native Unleashed
Cloud Native UnleashedCloud Native Unleashed
Cloud Native Unleashed
 
Everything as-code. Polyglotte Entwicklung in der Praxis. #oop2017
Everything as-code. Polyglotte Entwicklung in der Praxis. #oop2017Everything as-code. Polyglotte Entwicklung in der Praxis. #oop2017
Everything as-code. Polyglotte Entwicklung in der Praxis. #oop2017
 
Die Leichtigkeit des Seins: Bindings für Eclipse SmartHome entwickeln
Die Leichtigkeit des Seins: Bindings für Eclipse SmartHome entwickelnDie Leichtigkeit des Seins: Bindings für Eclipse SmartHome entwickeln
Die Leichtigkeit des Seins: Bindings für Eclipse SmartHome entwickeln
 
Clickstream Analysis with Spark - Understanding Visitors in Real Time
Clickstream Analysis with Spark - Understanding Visitors in Real TimeClickstream Analysis with Spark - Understanding Visitors in Real Time
Clickstream Analysis with Spark - Understanding Visitors in Real Time
 

Ähnlich wie Lightweight developer provisioning with gradle and seu as-code

Using Maven to build Java & Android program
Using Maven to build Java & Android programUsing Maven to build Java & Android program
Using Maven to build Java & Android program
Mu Chun Wang
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
維佋 唐
 
How to integrate front end tool via gruntjs
How to integrate front end tool via gruntjsHow to integrate front end tool via gruntjs
How to integrate front end tool via gruntjs
Bo-Yi Wu
 

Ähnlich wie Lightweight developer provisioning with gradle and seu as-code (20)

Lightweight Developer Provisioning with Gradle
Lightweight Developer Provisioning with GradleLightweight Developer Provisioning with Gradle
Lightweight Developer Provisioning with Gradle
 
Lightweight Developer Provisioning with Gradle and SEU-as-code
Lightweight Developer Provisioning with Gradle and SEU-as-codeLightweight Developer Provisioning with Gradle and SEU-as-code
Lightweight Developer Provisioning with Gradle and SEU-as-code
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
Everything-as-code. A polyglot journey.
Everything-as-code. A polyglot journey.Everything-as-code. A polyglot journey.
Everything-as-code. A polyglot journey.
 
Everything-as-code - a polyglot journey.
Everything-as-code - a polyglot journey.Everything-as-code - a polyglot journey.
Everything-as-code - a polyglot journey.
 
Using Maven to build Java & Android program
Using Maven to build Java & Android programUsing Maven to build Java & Android program
Using Maven to build Java & Android program
 
Polyglot Adventures for the Modern Java Developer #javaone2017
Polyglot Adventures for the Modern Java Developer #javaone2017Polyglot Adventures for the Modern Java Developer #javaone2017
Polyglot Adventures for the Modern Java Developer #javaone2017
 
Polyglot Adventures for the Modern Java Developer
Polyglot Adventures for the Modern Java DeveloperPolyglot Adventures for the Modern Java Developer
Polyglot Adventures for the Modern Java Developer
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
 
Everything-as-code – Polyglotte Entwicklung in der Praxis
Everything-as-code – Polyglotte Entwicklung in der PraxisEverything-as-code – Polyglotte Entwicklung in der Praxis
Everything-as-code – Polyglotte Entwicklung in der Praxis
 
React django
React djangoReact django
React django
 
Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)
 
Everything as a code
Everything as a codeEverything as a code
Everything as a code
 
What's new in Gradle 4.0
What's new in Gradle 4.0What's new in Gradle 4.0
What's new in Gradle 4.0
 
OpenCms Days 2012 - Developing OpenCms with Gradle
OpenCms Days 2012 - Developing OpenCms with GradleOpenCms Days 2012 - Developing OpenCms with Gradle
OpenCms Days 2012 - Developing OpenCms with Gradle
 
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOpsPVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
 
Node JS Express : Steps to Create Restful Web App
Node JS Express : Steps to Create Restful Web AppNode JS Express : Steps to Create Restful Web App
Node JS Express : Steps to Create Restful Web App
 
Making the Most of Your Gradle Builds
Making the Most of Your Gradle BuildsMaking the Most of Your Gradle Builds
Making the Most of Your Gradle Builds
 
How to integrate front end tool via gruntjs
How to integrate front end tool via gruntjsHow to integrate front end tool via gruntjs
How to integrate front end tool via gruntjs
 
What makes me "Grunt"?
What makes me "Grunt"? What makes me "Grunt"?
What makes me "Grunt"?
 

Mehr von QAware GmbH

"Mixed" Scrum-Teams – Die richtige Mischung macht's!
"Mixed" Scrum-Teams – Die richtige Mischung macht's!"Mixed" Scrum-Teams – Die richtige Mischung macht's!
"Mixed" Scrum-Teams – Die richtige Mischung macht's!
QAware GmbH
 
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
 Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See... Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
QAware GmbH
 

Mehr von QAware GmbH (20)

50 Shades of K8s Autoscaling #JavaLand24.pdf
50 Shades of K8s Autoscaling #JavaLand24.pdf50 Shades of K8s Autoscaling #JavaLand24.pdf
50 Shades of K8s Autoscaling #JavaLand24.pdf
 
Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...
Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...
Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...
 
Fully-managed Cloud-native Databases: The path to indefinite scale @ CNN Mainz
Fully-managed Cloud-native Databases: The path to indefinite scale @ CNN MainzFully-managed Cloud-native Databases: The path to indefinite scale @ CNN Mainz
Fully-managed Cloud-native Databases: The path to indefinite scale @ CNN Mainz
 
Down the Ivory Tower towards Agile Architecture
Down the Ivory Tower towards Agile ArchitectureDown the Ivory Tower towards Agile Architecture
Down the Ivory Tower towards Agile Architecture
 
"Mixed" Scrum-Teams – Die richtige Mischung macht's!
"Mixed" Scrum-Teams – Die richtige Mischung macht's!"Mixed" Scrum-Teams – Die richtige Mischung macht's!
"Mixed" Scrum-Teams – Die richtige Mischung macht's!
 
Make Developers Fly: Principles for Platform Engineering
Make Developers Fly: Principles for Platform EngineeringMake Developers Fly: Principles for Platform Engineering
Make Developers Fly: Principles for Platform Engineering
 
Der Tod der Testpyramide? – Frontend-Testing mit Playwright
Der Tod der Testpyramide? – Frontend-Testing mit PlaywrightDer Tod der Testpyramide? – Frontend-Testing mit Playwright
Der Tod der Testpyramide? – Frontend-Testing mit Playwright
 
Was kommt nach den SPAs
Was kommt nach den SPAsWas kommt nach den SPAs
Was kommt nach den SPAs
 
Cloud Migration mit KI: der Turbo
Cloud Migration mit KI: der Turbo Cloud Migration mit KI: der Turbo
Cloud Migration mit KI: der Turbo
 
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
 Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See... Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
 
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
 
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
 
Kubernetes with Cilium in AWS - Experience Report!
Kubernetes with Cilium in AWS - Experience Report!Kubernetes with Cilium in AWS - Experience Report!
Kubernetes with Cilium in AWS - Experience Report!
 
50 Shades of K8s Autoscaling
50 Shades of K8s Autoscaling50 Shades of K8s Autoscaling
50 Shades of K8s Autoscaling
 
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAPKontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP
 
Service Mesh Pain & Gain. Experiences from a client project.
Service Mesh Pain & Gain. Experiences from a client project.Service Mesh Pain & Gain. Experiences from a client project.
Service Mesh Pain & Gain. Experiences from a client project.
 
50 Shades of K8s Autoscaling
50 Shades of K8s Autoscaling50 Shades of K8s Autoscaling
50 Shades of K8s Autoscaling
 
Blue turns green! Approaches and technologies for sustainable K8s clusters.
Blue turns green! Approaches and technologies for sustainable K8s clusters.Blue turns green! Approaches and technologies for sustainable K8s clusters.
Blue turns green! Approaches and technologies for sustainable K8s clusters.
 
Per Anhalter zu Cloud Nativen API Gateways
Per Anhalter zu Cloud Nativen API GatewaysPer Anhalter zu Cloud Nativen API Gateways
Per Anhalter zu Cloud Nativen API Gateways
 
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
 

Kürzlich hochgeladen

Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
amitlee9823
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
AroojKhan71
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
amitlee9823
 

Kürzlich hochgeladen (20)

Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
ALSO dropshipping via API with DroFx.pptx
ALSO dropshipping via API with DroFx.pptxALSO dropshipping via API with DroFx.pptx
ALSO dropshipping via API with DroFx.pptx
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 

Lightweight developer provisioning with gradle and seu as-code

  • 1. Lightweight Developer Provisioning with Gradle and SEU-as-code | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 1
  • 2. About me Mario-Leander Reimer Chief Technologist, QAware GmbH mario-leander.reimer@qaware.de twitter://@LeanderReimer http://speakerdeck.com/lreimer http://github.com/lreimer http://github.com/seu-as-code http://seu-as-code.io http://www.qaware.de | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 2
  • 3. | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 3
  • 4. SEU: a German acronym; software development environment | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 4
  • 5. Definition of Software Industrialization • This has nothing to do with cheap labor! • Automation of repetitive and laborious tasks • Better software quality through standardized, streamlined tooling • Well integrated tool chain leads to a higher productivity and happiness of your team • Better cost efficiency and competitiveness | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 5
  • 6. | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 6
  • 7. The ideal. | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 7
  • 8. | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 8
  • 9. The reality? | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 9
  • 10. What are the problems? • Manual and error prone creation and update procedure of individual SEUs • Individual SEUs produce different results and strange bugs • Old versions of a SEU can't easily be restored • The SEU for a new project is often a copy of a previous project. ! Broken windows! ! | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 10
  • 11. The solution ... • Use a build tool for the automated creation and update of a SEU • Software packages are expressed as dependencies • Gradle tasks and Groovy are used instead of shell scripting • Everything is version controlled just like ordinary source code | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 11
  • 12. Demo. | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 12
  • 13. The most minimalistic SEU plugins { id 'de.qaware.seu.as.code.base' version '2.4.0' } seuAsCode { seuHome = 'J:' projectName = 'JavaOne 2016' } | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 13
  • 14. Multi platform SEUs for mixed teams plugins { id 'de.qaware.seu.as.code.base' version '2.4.0' } import static de.qaware.seu.as.code.plugins.base.Platform.isMac seuAsCode { // use closure or Elvis operator (no syntax highlighting :( seuHome = { if (isMac()) '/Volumes/JavaOne-2016' else 'J:' } projectName = 'JavaOne 2016' } | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 14
  • 15. Software packages are dependencies • Gradle has built-in support for dependencies • Gradle supports different artifact repositories (Maven, Ivy, Directory) • Transitive dependencies between software packages are supported • Use dependency configurations to determine installation directory | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 15
  • 16. Software dependencies and configurations repositories { maven { url 'https://dl.bintray.com/seu-as-code/maven' } jcenter() } dependencies { seuac 'org.codehaus.groovy.modules.scriptom:scriptom:1.6.0' seuac 'com.h2database:h2:1.4.188' home 'de.qaware.seu.as.code:seuac-home:2.4.0' software 'de.qaware.seu.as.code:seuac-environment:2.4.0:jdk8' software 'org.gradle:gradle:2.14.1' software "net.java:openjdk8:8u40:$osClassifier" } | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 16
  • 17. Secure passwords with Credentials plugin plugins { id 'de.qaware.seu.as.code.credentials' version '2.4.0' } repositories { maven { url 'https://your.company.com/nexus/repo' credentials { // access stored credentials via extra property username project.credentials['Nexus'].username password project.credentials['Nexus'].password } } } | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 17
  • 18. Platform plugin for OS specific builds plugins { id 'de.qaware.seu.as.code.platform' version '1.0.0' } platform { win { task helloSeuAsCode(group: 'Example') << { println 'Hello SEU-as-code on Windows.' } } mac { task helloSeuAsCode(group: 'Example') << { println 'Hello SEU-as-code on MacOS.' } } } | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 18
  • 19. Manage sources with Git or SVN plugin plugins { id 'de.qaware.seu.as.code.credentials' version '2.4.0' id 'de.qaware.seu.as.code.git' version '2.3.0' } git { plugins { url 'https://github.com/seu-as-code/seu-as-code.plugins.git' directory file("$seuHome/codebase/plugins/") username project.credentials['Github'].username password project.credentials['Github'].password } } | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 19
  • 20. Manage sources with Git or SVN plugin plugins { id 'de.qaware.seu.as.code.credentials' version '2.4.0' id 'de.qaware.seu.as.code.svn' version '2.1.1' } subversion { usersGuide { url 'https://github.com/seu-as-code/seu-as-code.users-guide.git' directory file("$seuHome/docbase/users-guide/") username project.credentials['Subversion'].username password project.credentials['Subversion'].password } } | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 20
  • 21. Implement scripts using plain Gradle • Gradle build scripts are code! Be creative. • Gradle provides useful predefined tasks: Copy, Exec, Sync, Delete, ... • Gradle tasks can easily reuse Ant tasks. • Gradle tasks can be implemented in Groovy code. | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 21
  • 22. Example 1: Init and delete Derby DB ext.derbyHome = System.env['DERBY_HOME'] // import SQL file via the provided Derby command line tool task initDemoDb(type: Exec, group: 'Database') { workingDir "$derbyHome/bin" commandLine 'cmd', '/B', '/C', 'ij.bat', "$rootDir/scripts/init.sql" } task deleteDemoDb(type: Delete, group: 'Database') { delete "$derbyHome/demo" } | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 22
  • 23. Example 1: The Groovy SQL way import groovy.sql.* task initDemoDb(group: 'Database') << { def derby = [ url: 'jdbc:derby://localhost:1527/demo;create=true', driver: 'org.apache.derby.jdbc.ClientDriver', user: 'admin', password: 'secret' ] Sql.withInstance(derby) { execute file("$rootDir/scripts/database/init.sql").text } } | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 23
  • 24. Example 2: Restore Solr index data ext.cores = ['de_DE', 'en_GB', 'zh_CN'] task solrRestoreAll(group: 'Solr') { } cores.each { coreName -> def name = coreName.replaceAll("_", "").capitalize() task "solrRestore${name}"(type: Sync, group: 'Solr') { from zipTree("$rootDir/scripts/solr/${coreName}.zip") into "$seuHome/software/solr-4.7.2/example/solr/${coreName}" } solrRestoreAll.dependsOn "solrRestore${name}" } | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 24
  • 25. Don't use shell scripts. Use Gradle instead! | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 25
  • 26. Building software packages is easy • Software packages are essentially plain JAR files (software + customizations) • 26 packages available via a Bintray repository https://bintray.com/seu-as-code/maven • 44 package build blue-prints are available at Github, continuously growing. • Software packages can be build with Gradle! | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 26
  • 27. Let's build our first package using Gradle! | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 27
  • 28. | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 28
  • 29. Download the original binary distribution plugins { id 'de.undercouch.download' version '1.2' } import de.undercouch.gradle.tasks.download.Download task downloadArchive(type: Download) { src 'https://services.gradle.org/distributions/gradle-3.0-all.zip' dest "$buildDir" } | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 29
  • 30. Unpack archive using simple Gradle task task extractArchive(type: Copy, dependsOn: downloadArchive) { from { zipTree("$buildDir/${project.name}-${version}-all.zip") } into "$buildDir/files" } // Best practice: directory name matches the package name // optionally rename the extracted directory if required | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 30
  • 31. Customize with additional files and hooks // plain Groovy, place as a file under META-INF/hooks/ import org.codehaus.groovy.scriptom.* Scriptom.inApartment { def wshShell = new ActiveXObject("WScript.Shell") def shortcut = wshShell.CreateShortcut("$seuHomegradle.lnk") shortcut.TargetPath = "${seuLayout.software}go-gradle.bat" shortcut.WorkingDirectory = "${seuLayout.codebase}" shortcut.Save() } | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 31
  • 32. Repackage all files as a normal JAR file task buildPackage(type: Jar, dependsOn: extractArchive) { baseName project.name version version extension 'jar' // classifier 'x86' destinationDir buildDir from "$buildDir/files" // the extracted files from "files" // some extra files } | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 32
  • 33. Publish JAR artifact to a repository server publishing { publications { gradle(MavenPublication) { artifact "${buildDir}/${project.name}-${version}.jar" } } repositories { maven { // alternatively, use your private company repository server url 'https://bintray.com/seu-as-code/maven' credentials { ... } } } } | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 33
  • 34. What's next? | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 34
  • 35. More features to come ... • Continuously add more software packages • Create plugin to build software packages • Support for self-downloading packages • Add support for other package managers • Add Vault support for Credentials plugin • Improve documentation and user’s guide | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 35
  • 36. Star SEU-as-code on Github! $ git clone https://github.com/seu-as-code/seu-as-code.archetype.git $ git clone https://github.com/seu-as-code/seu-as-code.plugins.git $ git clone https://github.com/seu-as-code/seu-as-code.packages.git $ git clone https://github.com/seu-as-code/seu-as-code.examples.git $ git clone https://github.com/seu-as-code/seu-as-code.documentation.git $ git clone https://github.com/seu-as-code/seu-as-code.users-guide.git | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 36
  • 37. Q & A | JavaOne 2016 | task seuAsCode() << { println "created with ❤ and ☕ by @LeanderReimer" } 37