Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
isochrone-vm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institut für Informatik
dbis
dbis-isochrone
isochrone-vm
Commits
245a46c4
Commit
245a46c4
authored
10 years ago
by
User expired
Browse files
Options
Downloads
Patches
Plain Diff
Increased version number
parent
4d4744f5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build.gradle
+150
-150
150 additions, 150 deletions
build.gradle
with
150 additions
and
150 deletions
build.gradle
+
150
−
150
View file @
245a46c4
// 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.4.
0
-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
// 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.4.
1
-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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment