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

added vm configuration (from project isochrone)

parent 94bb6649
No related branches found
No related tags found
No related merge requests found
Showing
with 1318 additions and 0 deletions
/.classpath
/.gradle
/.project
/.settings
/.vagrant
\ No newline at end of file
# -*- mode: ruby -*-
# vi: set ft=ruby :
REQUIRED_PLUGINS = %w(vagrant-cachier vagrant-vbguest)
exit unless REQUIRED_PLUGINS.all? do |plugin|
Vagrant.has_plugin?(plugin) || (
puts "The #{plugin} plugin is required. Please install it with:"
puts "$ vagrant plugin install #{plugin}"
false
)
end
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
HOSTNAME=`hostname -s`
isLocalMode=true
if HOSTNAME.strip.eql? "dbis-w65107"
# puts "Server mode"
isLocalMode=false
else
# puts "Local mode"
isLocalMode=true
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.boot_timeout = 600
# Hardware configuration
# WARNING: Be VERY careful with this settings!!!
# -> giving the client more cores can SLOW DOWN the VM (if there is not enough workload on the guest, two less cores on the host...)
config.vm.provider "virtualbox" do |v|
v.name = (isLocalMode ? "isochrone-local" : "isochrone")
v.gui = false
v.cpus = 1
v.memory = 2048
v.customize ["modifyvm", :id, "--cpuexecutioncap", "100"]
v.customize ["modifyvm", :id, "--ostype", "RedHat_64"]
end
# Enable vagrant-cachier plugin
config.cache.enable :yum
# Information about the box itself (name from vagrantcloud)
config.vm.box = "jayunit100/centos7"
# Setup of shared folders
config.vm.synced_folder "conf", "/setup/conf"
config.vm.synced_folder "img", "/setup/img"
# Setup environment on startup (done using a shell script)
config.vm.provision "shell", path: "bootstrap.sh", args: ["niko", "secretPhdPassword#2014!", (isLocalMode ? "true" : "false")]
# Network configuration
config.vm.network :forwarded_port, guest: 5432, host: 5432, auto_correct: true, id: "postgresql"
config.vm.network :forwarded_port, guest: 7474, host: 7474, auto_correct: true, id: "neo4j"
config.vm.network :forwarded_port, guest: 80, host: 8000, auto_correct: true, id: "httpd"
unless isLocalMode
config.vm.network :forwarded_port, guest: 8080, host: 8080, auto_correct: true, id: "tomcat"
end
# config.vm.network :private_network, :ip => '192.168.4.50'
# config.vm.network :public_network
end
This diff is collapsed.
// Plugin declaration
plugins {
id 'com.bmuschko.vagrant' version '2.0'
id 'com.kageiit.url-cache' version '1.0.0'
id 'org.ajoberstar.grgit-release' version '0.10.0'
}
apply plugin: 'eclipse'
import org.ajoberstar.grgit.*
import org.apache.tools.ant.filters.FixCrLfFilter
import org.apache.tools.ant.filters.ReplaceTokens
// Basic settings
group = 'at.uibk.dbis'
version = '0.3.7-SNAPSHOT'
description = 'PhD project of Nikolaus Krismer (infrastructure as vagrantbox)'
ext {
vagrantDir = getProjectDir()
}
// Groovy method declaration
def getDate() {
def date = new Date()
def formattedDate = date.format('yyyyMMdd')
return formattedDate
}
// Detailled settings (dependencies, tasks, task configuration, ...)
eclipse {
project {
natures = [
'org.springsource.ide.eclipse.gradle.core.nature'
]
file {
withXml { xmlProvider ->
Node project = xmlProvider.asNode()
Node filteredResources = project.appendNode('filteredResources');
Node filterGit = filteredResources.appendNode('filter')
filterGit.appendNode('id', 1421146667415)
filterGit.appendNode('name', '')
filterGit.appendNode('type', 30)
Node matcherGit = filterGradle.appendNode('matcher')
matcherGit.appendNode('id', 'org.eclipse.ui.ide.multiFilter')
matcherGit.appendNode('arguments', '1.0-name-matches-false-false-.git')
Node filterGradle = filteredResources.appendNode('filter')
filterGradle.appendNode('id', 1392635165065)
filterGradle.appendNode('name', '')
filterGradle.appendNode('type', 30)
Node matcherGradle = filterGradle.appendNode('matcher')
matcherGradle.appendNode('id', 'org.eclipse.ui.ide.multiFilter')
matcherGradle.appendNode('arguments', '1.0-name-matches-false-false-.gradle')
Node filterVagrant = filteredResources.appendNode('filter')
filterVagrant.appendNode('id', 1392635165131)
filterVagrant.appendNode('name', '')
filterVagrant.appendNode('type', 30)
Node matcherVagrant = filterVagrant.appendNode('matcher')
matcherVagrant.appendNode('id', 'org.eclipse.ui.ide.multiFilter')
matcherVagrant.appendNode('arguments', '1.0-name-matches-false-false-.vagrant')
}
}
}
}
vagrant {
provider = 'virtualbox'
}
vagrantDestroy.doFirst {
if (!vagrantDir.isDirectory()) {
throw new StopExecutionException()
}
}
// Custom tasks
task changelog << {
def grgit = Grgit.open(project.file('.'))
def fileChangelog = new File('CHANGELOG.md')
def tags = ["HEAD"]
grgit.tag.list().reverse().each{ t ->
tags += t.getName()
}
fileChangelog.delete()
def builder
def commits;
def numTags = tags.size()
for (int i = 0; i < numTags; i++) {
builder = new StringBuilder()
builder.append("- Version ${tags[i]}:\n".replaceAll('Version HEAD', 'Upcoming version'))
if (tags[i+1] == null) {
commits = grgit.log(includes: [tags[i]])
} else {
commits = grgit.log { range tags[i+1], tags[i]; }
}
commits.inject(builder) { bldr, commit ->
bldr.append(' - ')
bldr.append(commit.shortMessage)
bldr.append('\n')
}
fileChangelog << builder.toString()
}
}
task vagrantExport(type: Zip) {
description = 'Builds an archive file that contains the files, needed to create the vagrant box'
from 'etc/vagrant'
appendix = ''
baseName = 'vagrantbox'
classifier = ''
version = getDate()
filter(FixCrLfFilter)
filter(ReplaceTokens, tokens: [db_username: 'myUser', db_password: 'myPassword'])
}
task vagrantPrepare << {
description = 'Prepares the vagrant environment (creates directory, copies Vagrantfile, ...)'
if (!vagrantDir.isDirectory()) {
println "Creating directory $vagrantDir and copying content"
vagrantDir.mkdirs()
sync {
from files('etc/vagrant')
into vagrantDir
filter(FixCrLfFilter)
filter(ReplaceTokens, tokens: [db_username: 'niko', db_password: 'secretPhdPassword#2014!'])
}
}
}
// task dependencies
tasks.vagrantUp.dependsOn vagrantPrepare
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
datastore create --workspace isochrone --name Neo4J --connectionParams "dbtype=neo4j 'The directory path of the Neo4j database: '=/opt/neo4j/data/graph.db"
datastore modify --workspace isochrone --name Neo4J --description "Neo4J datastore"
datastore modify --workspace isochrone --name Neo4J --enabled true
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
#layer group create --workspace isochrone --layers n4j_bz_ways,n4j_ibk_ways --name n4j_ways --styles line,line
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
# ToDo: Create featuretype for datastore "Neo4j" and public roads in bozen
# featuretype publish --workspace isochrone --datastore Neo4J --featuretype /opt/bozen-131201-filtered.osm
# featuretype create --workspace isochrone --datastore Neo4J --featuretype /opt/bozen-131201-filtered.osm --enabled true --advertised true --title neo4j_bz_ways --srs EPSG:4326 --schema "the_geom:LineString:srid=4326" --projectionpolicy FORCE_DECLARED
\ No newline at end of file
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
# ToDo: Create featuretype for datastore "Neo4j" and public roads in innsbruck
# featuretype publish --workspace isochrone --datastore Neo4J --featuretype /opt/innsbruck-131201-filtered.osm
# featuretype create --workspace isochrone --datastore Neo4J --featuretype /opt/innsbruck-131201-filtered.osm --enabled true --advertised true --title neo4j_ibk_ways --srs EPSG:4326 --schema "the_geom:LineString:srid=4326" --projectionpolicy FORCE_DECLARED
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
# ToDo: Create featuretype for datastore "Neo4j" and public roads in italy
# featuretype publish --workspace isochrone --datastore Neo4J --featuretype /opt/italy-131201-filtered.osm
# featuretype create --workspace isochrone --datastore Neo4J --featuretype /opt/italy-131201-filtered.osm --enabled true --advertised true --title neo4j_it_ways --srs EPSG:4326 --schema "the_geom:LineString:srid=4326" --projectionpolicy FORCE_DECLARED
\ No newline at end of file
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
# ToDo: Create featuretype for datastore "Neo4j" and public roads in italy
# featuretype publish --workspace isochrone --datastore Neo4J --featuretype /opt/sanfrancisco-131201-filtered.osm
# featuretype create --workspace isochrone --datastore Neo4J --featuretype /opt/sanfrancisco-131201-filtered.osm --enabled true --advertised true --title neo4j_sf_ways --srs EPSG:4326 --schema "the_geom:LineString:srid=4326" --projectionpolicy FORCE_DECLARED
\ No newline at end of file
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
# ToDo: Create featuretype for datastore "Neo4j" and public roads in southern tyrol
# featuretype publish --workspace isochrone --datastore Neo4J --featuretype /opt/southtyrol-131201-filtered.osm
# featuretype create --workspace isochrone --datastore Neo4J --featuretype /opt/southtyrol-131201-filtered.osm --enabled true --advertised true --title neo4j_st_ways --srs EPSG:4326 --schema "the_geom:LineString:srid=4326" --projectionpolicy FORCE_DECLARED
\ No newline at end of file
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
postgis datastore create --workspace isochrone --datastore PostGIS --host localhost --port 5432 --database isochrone --schema public --user @db_username@ --password @db_password@
datastore modify --workspace isochrone --name PostGIS --description "PostGIS datastore"
datastore modify --workspace isochrone --name PostGIS --enabled true
\ No newline at end of file
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
layer group create --workspace isochrone --layers pg_bz_ways,pg_ibk_ways --name pg_ways --styles line,line
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
postgis featuretype publish --workspace isochrone --datastore PostGIS --table bz_ways
featuretype modify --workspace isochrone --datastore PostGIS --featuretype "bz_ways" --name "pg_bz_ways"
featuretype modify --workspace isochrone --datastore PostGIS --featuretype "pg_bz_ways" --title "Ways in Bozen"
featuretype modify --workspace isochrone --datastore PostGIS --featuretype "pg_bz_ways" --enabled true
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
postgis featuretype publish --workspace isochrone --datastore PostGIS --table ibk_ways
featuretype modify --workspace isochrone --datastore PostGIS --featuretype "ibk_ways" --name "pg_ibk_ways"
featuretype modify --workspace isochrone --datastore PostGIS --featuretype "pg_ibk_ways" --title "Ways in Innsbruck"
featuretype modify --workspace isochrone --datastore PostGIS --featuretype "pg_ibk_ways" --enabled true
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
postgis featuretype publish --workspace isochrone --datastore PostGIS --table it_ways
featuretype modify --workspace isochrone --datastore PostGIS --featuretype "it_ways" --name "pg_it_ways"
featuretype modify --workspace isochrone --datastore PostGIS --featuretype "pg_it_ways" --title "Ways in Italy"
featuretype modify --workspace isochrone --datastore PostGIS --featuretype "pg_it_ways" --enabled true
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
postgis featuretype publish --workspace isochrone --datastore PostGIS --table sf_ways
featuretype modify --workspace isochrone --datastore PostGIS --featuretype "sf_ways" --name "pg_sf_ways"
featuretype modify --workspace isochrone --datastore PostGIS --featuretype "pg_sf_ways" --title "Ways in SanFrancisco"
featuretype modify --workspace isochrone --datastore PostGIS --featuretype "pg_sf_ways" --enabled true
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
postgis featuretype publish --workspace isochrone --datastore PostGIS --table st_ways
featuretype modify --workspace isochrone --datastore PostGIS --featuretype "st_ways" --name "pg_st_ways"
featuretype modify --workspace isochrone --datastore PostGIS --featuretype "pg_st_ways" --title "Ways in SouthTyrol"
featuretype modify --workspace isochrone --datastore PostGIS --featuretype "pg_st_ways" --enabled true
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
style create --file /setup/conf/geoserver_style_edge.sld --name StyleEdge
style create --file /setup/conf/geoserver_style_edgeexpiration.sld --name StyleEdgeExpiration
style create --file /setup/conf/geoserver_style_isocoverage.sld --name StyleIsoCoverage
style create --file /setup/conf/geoserver_style_stations.sld --name StyleTransportationStations
style create --file /setup/conf/geoserver_style_nodeexpiration.sld --name StyleNodeExpiration
geoserver set --url http://localhost:8080/geoserver --user admin --password geoserver
workspace create --name isochrone
workspace default set --name isochrone
namespace modify --prefix isochrone --uri de.krismer.isochrone
ows wms create --workspace isochrone
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