Skip to content
Snippets Groups Projects
Commit 29185ebb authored by User expired's avatar User expired
Browse files

choosing vagrant provider depending on host (in gradle; not only in vagrantfile)

parent 82e8d1f2
No related branches found
No related tags found
No related merge requests found
Upcoming version: Upcoming version:
----------------- -----------------
- choosing vagrant provider depending on host (in gradle; not only in vagrantfile) (Nikolaus Krismer)
- not validating vagrant installation in gradle anymore (Nikolaus Krismer) - not validating vagrant installation in gradle anymore (Nikolaus Krismer)
- removed provider definition from gradle (only needed within vagrant) (Nikolaus Krismer) - removed provider definition from gradle (only needed within vagrant) (Nikolaus Krismer)
- fixed syntax error in Vagrantfile (Nikolaus Krismer) - fixed syntax error in Vagrantfile (Nikolaus Krismer)
......
...@@ -36,6 +36,25 @@ def getDate() { ...@@ -36,6 +36,25 @@ def getDate() {
return formattedDate return formattedDate
} }
def getHostname() {
InetAddress result = null;
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
Enumeration<InetAddress> addresses = interfaces.nextElement().getInetAddresses();
while (addresses.hasMoreElements()) {
InetAddress address = addresses.nextElement();
if (!address.isLoopbackAddress()) {
if (address.isSiteLocalAddress()) {
return address.getHostName();
} else if (result == null) {
result = address;
}
}
}
}
return (result != null ? result : InetAddress.getLocalHost()).getHostName();
}
// Repositories, Configurations, Dependencies and SourceSets setup // Repositories, Configurations, Dependencies and SourceSets setup
repositories { repositories {
...@@ -88,9 +107,8 @@ scmversion { ...@@ -88,9 +107,8 @@ scmversion {
} }
vagrant { vagrant {
installation { def hostname = getHostname();
validate = false provider = (hostname.startsWith('ci') || hostname.startsWith('dbis-ci') || hostname.startsWith('isochrone') || hostname.startsWith('dbis-isochrone')) ? 'libvirt' : 'virtualbox';
}
} }
vagrantDestroy.doFirst { vagrantDestroy.doFirst {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment