Skip to content

Commit

Permalink
updated README and build process to reflect new repo structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Sep 30, 2018
1 parent bb35361 commit ad672e9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
9 changes: 9 additions & 0 deletions Makefile
Expand Up @@ -15,6 +15,15 @@ install_r:
cp README.md r-pkg/
R CMD INSTALL r-pkg/

coverage_r:
echo "Calculating test coverage..."
Rscript -e "Sys.setenv(NOT_CRAN = 'true'); coverage <- covr::package_coverage('r-pkg/'); print(coverage); covr::report(coverage, './coverage.html')"
echo "Done calculating coverage"
open coverage.html

test_r:
Rscript -e "devtools::test('r-pkg')"

install_py:
cp LICENSE py-pkg/
cp NEWS.md py-pkg/
Expand Down
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -34,7 +34,7 @@ install.packages('uptasticsearch')
To use the development version of the package, which has the newest changes, you can install directly from GitHub

```
devtools::install_github("UptakeOpenSource/uptasticsearch")
devtools::install_github("UptakeOpenSource/uptasticsearch", subdir = "r-pkg")
```

### Python <a name="pythoninstallation"></a>
Expand Down Expand Up @@ -202,10 +202,10 @@ To run the code below, you will need [Docker](https://www.docker.com/). Note tha
./setup_local.sh 5.5
# Run tests
Rscript -e "devtools::test()"
make test_r
# Get test coverage and generate coverage report
./coverage.sh
make coverage_r
# Tear down the container and remove testing files
./cleanup_local.sh
Expand Down
9 changes: 0 additions & 9 deletions coverage.sh

This file was deleted.

34 changes: 17 additions & 17 deletions setup_local.sh
Expand Up @@ -10,79 +10,79 @@ echo "major version: $MAJOR_VERSION"

WDIR=$(pwd)
TESTDIR=${WDIR}/sandbox
SAMPLE_DATA_FILE=$(pwd)/inst/testdata/sample.json
SAMPLE_DATA_FILE=$(pwd)/r-pkg/inst/testdata/sample.json
ES_HOST="127.0.0.1"

echo "Starting up Elasticsearch..."

case "${MAJOR_VERSION}" in

1.0) docker run -d -p 9200:9200 barnybug/elasticsearch:1.0.0
MAPPING_FILE=$(pwd)/inst/testdata/legacy_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/legacy_shakespeare_mapping.json
;;
1.4) docker run -d -p 9200:9200 barnybug/elasticsearch:1.4.4
MAPPING_FILE=$(pwd)/inst/testdata/legacy_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/legacy_shakespeare_mapping.json
;;
1.7) docker run -d -p 9200:9200 barnybug/elasticsearch:1.7.2
MAPPING_FILE=$(pwd)/inst/testdata/legacy_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/legacy_shakespeare_mapping.json
;;
2.0) docker run -d -p 9200:9200 docker.elastic.co/elasticsearch/elasticsearch:2.0.2
MAPPING_FILE=$(pwd)/inst/testdata/legacy_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/legacy_shakespeare_mapping.json
;;
2.1) docker run -d -p 9200:9200 docker.elastic.co/elasticsearch/elasticsearch:2.1.2
MAPPING_FILE=$(pwd)/inst/testdata/legacy_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/legacy_shakespeare_mapping.json
;;
2.2) docker run -d -p 9200:9200 docker.elastic.co/elasticsearch/elasticsearch:2.2.2
MAPPING_FILE=$(pwd)/inst/testdata/legacy_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/legacy_shakespeare_mapping.json
;;
2.3) docker run -d -p 9200:9200 docker.elastic.co/elasticsearch/elasticsearch:2.3.5
MAPPING_FILE=$(pwd)/inst/testdata/legacy_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/legacy_shakespeare_mapping.json
;;
2.4) docker run -d -p 9200:9200 docker.elastic.co/elasticsearch/elasticsearch:2.4.6
MAPPING_FILE=$(pwd)/inst/testdata/legacy_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/legacy_shakespeare_mapping.json
;;
5.0) docker run -d -p 9200:9200 \
-e "xpack.security.enabled=false" \
docker.elastic.co/elasticsearch/elasticsearch:5.0.2
MAPPING_FILE=$(pwd)/inst/testdata/es5_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/es5_shakespeare_mapping.json
;;
5.3) docker run -d -p 9200:9200 \
-e "xpack.security.enabled=false" \
docker.elastic.co/elasticsearch/elasticsearch:5.3.3
MAPPING_FILE=$(pwd)/inst/testdata/es5_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/es5_shakespeare_mapping.json
;;
5.4) docker run -d -p 9200:9200 \
-e "xpack.security.enabled=false" \
docker.elastic.co/elasticsearch/elasticsearch:5.4.3
MAPPING_FILE=$(pwd)/inst/testdata/es5_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/es5_shakespeare_mapping.json
;;
5.5) docker run -d -p 9200:9200 \
-e "xpack.security.enabled=false" \
docker.elastic.co/elasticsearch/elasticsearch:5.5.3
MAPPING_FILE=$(pwd)/inst/testdata/es5_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/es5_shakespeare_mapping.json
;;
5.6) docker run -d -p 9200:9200 \
-e "xpack.security.enabled=false" \
docker.elastic.co/elasticsearch/elasticsearch:5.6.9
MAPPING_FILE=$(pwd)/inst/testdata/es5_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/es5_shakespeare_mapping.json
;;
6.0) docker run -d -p 9200:9200 \
-e "discovery.type=single-node" \
-e "xpack.security.enabled=false" \
docker.elastic.co/elasticsearch/elasticsearch:6.0.1
MAPPING_FILE=$(pwd)/inst/testdata/es6_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/es6_shakespeare_mapping.json
;;
6.1) docker run -d -p 9200:9200 \
-e "discovery.type=single-node" \
-e "xpack.security.enabled=false" \
docker.elastic.co/elasticsearch/elasticsearch:6.1.4
MAPPING_FILE=$(pwd)/inst/testdata/es6_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/es6_shakespeare_mapping.json
;;
6.2) docker run -d -p 9200:9200 \
-e "discovery.type=single-node" \
-e "xpack.security.enabled=false" \
docker.elastic.co/elasticsearch/elasticsearch:6.2.4
MAPPING_FILE=$(pwd)/inst/testdata/es6_shakespeare_mapping.json
MAPPING_FILE=$(pwd)/r-pkg/inst/testdata/es6_shakespeare_mapping.json
;;
*) echo "Did not recognize version ${MAJOR_VERSION}. Not starting Elasticsearch"
exit 1
Expand Down

0 comments on commit ad672e9

Please sign in to comment.