Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/correct-spelling-of-elasticsearch #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# gradle-elasticsearch-plugin
An ElasticSearch gradle plugin for starting an ElasticSearch within a gradle build.
An Elasticsearch gradle plugin for starting an Elasticsearch within a gradle build.

[ ![Build Status](https://travis-ci.org/cgoIT/gradle-elasticsearch-plugin.svg?branch=master) ](https://travis-ci.org/amirkibbar/bilberry)
[ ![Download](https://api.bintray.com/packages/cgoit/maven/gradle-elasticsearch-plugin/images/download.svg) ](https://bintray.com/cgoIT/maven/gradle-elasticsearch-plugin/_latestVersion)
Expand Down Expand Up @@ -36,7 +36,7 @@ Plugin setup with gradle < 2.1:
apply plugin: 'cgoit.gradle.elasticsearch'
```

# Starting and stopping ElasticSearch during the integration tests
# Starting and stopping Elasticsearch during the integration tests

```gradle

Expand Down Expand Up @@ -89,7 +89,7 @@ The above example shows a task called integrationTests which runs all the tests
reports for these tests are placed in the buildDir/reports/integration-tests directory - just to separate them from
regular tests. But the important part here is in the doFirst and doLast.

In the doFirst ElasticSearch is started. All the values in the example above are the default values, so if these values
In the doFirst Elasticsearch is started. All the values in the example above are the default values, so if these values
work for you they can be ommitted:

```gradle
Expand All @@ -99,13 +99,13 @@ work for you they can be ommitted:
}
```

In the doLast ElasticSearch is stopped. Note that ElasticSearch is also stopped in the gradle.taskGraph.afterTask
section - this is to catch any crashes during the integration tests and make sure that ElasticSearch is stopped in the
In the doLast Elasticsearch is stopped. Note that Elasticsearch is also stopped in the gradle.taskGraph.afterTask
section - this is to catch any crashes during the integration tests and make sure that Elasticsearch is stopped in the
build clean-up phase.

Lastly the regular test task is configured to exclude the tests with the IT suffix - we only wanted to run these in the
integration tests phase, not with the regular tests.

# References

- [ElasticSearch](https://www.elastic.co/products/elasticsearch)
- [Elasticsearch](https://www.elastic.co/products/elasticsearch)
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ publishing {

pom.withXml {
def root = asNode()
root.appendNode('description', 'a gradle plugin for starting and stopping ElasticSearch during integration tests')
root.appendNode('description', 'a gradle plugin for starting and stopping Elasticsearch during integration tests')
root.children().last() + pomConfig
}
}
Expand Down Expand Up @@ -95,7 +95,7 @@ bintray {
issueTrackerUrl = "https://github.com/cgoIT/$repoName/issues"
vcsUrl = "https://github.com/cgoIT/${repoName}.git"
licenses = ['Apache-2.0']
labels = ['gradle', 'plugin', 'elastic', 'ElasticSearch', repoName]
labels = ['gradle', 'plugin', 'elastic', 'Elasticsearch', repoName]
version {
name = project.version
}
Expand All @@ -105,13 +105,13 @@ bintray {
pluginBundle {
website = "https://github.com/cgoIT/$repoName"
vcsUrl = "https://github.com/cgoIT/${repoName}.git"
description = 'An ElasticSearch gradle plugin for starting an ElasticSearch within a gradle build.'
tags = ['elastic', 'ElasticSearch']
description = 'An Elasticsearch gradle plugin for starting an Elasticsearch within a gradle build.'
tags = ['elastic', 'Elasticsearch']

plugins {
greetingsPlugin {
id = project.group
displayName = 'Gradle ElasticSearch plugin'
displayName = 'Gradle Elasticsearch plugin'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class ElasticsearchActions {
}

boolean stopRunning() {
println "${CYAN}* elastic:$NORMAL stopping ElasticSearch"
println "${CYAN}* elastic:$NORMAL stopping Elasticsearch"

try {
if (Integer.valueOf(version.split("\\.")[0]) >= 2) {
Expand All @@ -116,8 +116,8 @@ class ElasticsearchActions {
}

if (!elasticPid) {
println "${RED}* elastic:$NORMAL could not get pid of running ElasticSearch!"
println "${RED}* elastic:$NORMAL could not stop ElasticSearch, please check manually!"
println "${RED}* elastic:$NORMAL could not get pid of running Elasticsearch!"
println "${RED}* elastic:$NORMAL could not stop Elasticsearch, please check manually!"
return false
}
println "${CYAN}* elastic:$NORMAL going to kill pid $elasticPid"
Expand All @@ -132,15 +132,15 @@ class ElasticsearchActions {
execute(Post("${httpScheme}://${httpHost}:${httpPort}/_shutdown"))
}

println "${CYAN}* elastic:$NORMAL waiting for ElasticSearch to shutdown"
println "${CYAN}* elastic:$NORMAL waiting for Elasticsearch to shutdown"
boolean shutdown = waitForShutdown(120)

if (!shutdown) {
println "${RED}* elastic:$NORMAL could not stop ElasticSearch"
println "${RED}* elastic:$NORMAL could not stop Elasticsearch"
return false
}

println "${CYAN}* elastic:$NORMAL ElasticSearch is now down"
println "${CYAN}* elastic:$NORMAL Elasticsearch is now down"
} catch (ConnectException e) {
println "${CYAN}* elastic:$YELLOW warning - unable to stop elastic on http port ${httpPort}, ${e.message}$NORMAL"
return false
Expand Down Expand Up @@ -182,7 +182,7 @@ class ElasticsearchActions {

void install() {
if (isInstalled()) {
println "${CYAN}* elastic:$NORMAL elastic search version $version detected at $home"
println "${CYAN}* elastic:$NORMAL Elasticsearch version $version detected at $home"
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,20 @@ class StartElasticsearchAction {

if (elastic.isRunning()) {
if (BooleanUtils.isFalse(forceShutdownBeforeStart)) {
println "${YELLOW}* elastic:$NORMAL ElasticSearch seems to be running at pid ${pidFile.text}"
println "${YELLOW}* elastic:$NORMAL Elasticsearch seems to be running at pid ${pidFile.text}"
println "${YELLOW}* elastic:$NORMAL please check $pidFile"
return
}

String pid = elastic.getPid()
println "${CYAN}* elastic:$NORMAL ElasticSearch seems to be running at pid ${pid} and 'forceShutdownBeforeStart=true'"
println "${CYAN}* elastic:$NORMAL Elasticsearch seems to be running at pid ${pid} and 'forceShutdownBeforeStart=true'"
elastic.stopRunning()
}

println "${CYAN}* elastic:$NORMAL starting ElasticSearch at $elastic.home using http port $httpPort and tcp transport port $transportPort"
println "${CYAN}* elastic:$NORMAL ElasticSearch data directory: $dataDir"
println "${CYAN}* elastic:$NORMAL ElasticSearch logs directory: $logsDir"
println "${CYAN}* elastic:$NORMAL ElasticSearch tmp directory: $tmpDir"
println "${CYAN}* elastic:$NORMAL starting Elasticsearch at $elastic.home using http port $httpPort and tcp transport port $transportPort"
println "${CYAN}* elastic:$NORMAL Elasticsearch data directory: $dataDir"
println "${CYAN}* elastic:$NORMAL Elasticsearch logs directory: $logsDir"
println "${CYAN}* elastic:$NORMAL Elasticsearch tmp directory: $tmpDir"

ant.delete(failonerror: true, dir: dataDir)
ant.delete(failonerror: true, dir: logsDir)
Expand All @@ -118,7 +118,7 @@ class StartElasticsearchAction {
"${optPrefix}xpack.ml.enabled=false"
]

println "${CYAN}* elastic:$NORMAL start ElasticSearch with parameters: ${command.toListString()}"
println "${CYAN}* elastic:$NORMAL start Elasticsearch with parameters: ${command.toListString()}"

if (!isFamily(FAMILY_WINDOWS)) {
command += [
Expand Down Expand Up @@ -154,7 +154,7 @@ class StartElasticsearchAction {
def out = new StringBuilder()
p.consumeProcessOutput(out, out)

println "${CYAN}* elastic:$NORMAL waiting for ElasticSearch to start"
println "${CYAN}* elastic:$NORMAL waiting for Elasticsearch to start"
boolean running = elastic.isRunning(120)

println out
Expand All @@ -171,10 +171,10 @@ class StartElasticsearchAction {
it.write(elastic.getPid())
}
}
println "${CYAN}* elastic:$NORMAL ElasticSearch is now up"
println "${CYAN}* elastic:$NORMAL Elasticsearch is now up"
} else {
println "${RED}* elastic:$NORMAL could not start ElasticSearch"
throw new RuntimeException("failed to start ElasticSearch")
println "${RED}* elastic:$NORMAL could not start Elasticsearch"
throw new RuntimeException("failed to start Elasticsearch")
}
}
}