-
Notifications
You must be signed in to change notification settings - Fork 36
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
simplified CI setup #163
Merged
Merged
simplified CI setup #163
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
# failure is a natural part of life | ||
set -e | ||
|
||
if [[ "$TASK" == "rpkg" ]]; then | ||
R_PACKAGE_DIR=$(pwd)/r-pkg | ||
R CMD INSTALL \ | ||
--clean \ | ||
${R_PACKAGE_DIR} | ||
fi | ||
|
||
if [[ "$TASK" == "pypkg" ]]; then | ||
PY_PACKAGE_DIR=$(pwd)/py-pkg | ||
pip install ${R_PACKAGE_DIR} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
# failure is a natural part of life | ||
set -e | ||
|
||
if [[ "$TASK" == "rpkg" ]]; then | ||
Rscript -e " \ | ||
install.packages('covr'); \ | ||
Sys.setenv(NOT_CRAN = 'true'); \ | ||
covr::codecov('r-pkg/') \ | ||
" | ||
fi | ||
|
||
if [[ "$TASK" == "pypkg" ]]; then | ||
echo "This is a Python build. No post-build actions configured." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
#!/bin/bash | ||
|
||
# failure is a natural part of life | ||
set -e | ||
|
||
# set up some parameters | ||
ES_HOST=http://127.0.0.1:9200 | ||
SLEEP_TIL_STARTUP_SECONDS=20 | ||
|
||
# where can you get ES binaries? | ||
ES1_ARCHIVE=https://download.elasticsearch.org/elasticsearch/elasticsearch | ||
ES2_ARCHIVE=https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch | ||
ES5PLUS_ARCHIVE=https://artifacts.elastic.co/downloads/elasticsearch | ||
|
||
# where is the test data? what file has the mapping for the test "shakespeare" index? | ||
TEST_DATA_DIR=$(pwd)/test_data | ||
LEGACY_MAPPING_FILE="${TEST_DATA_DIR}/legacy_shakespeare_mapping.json" | ||
ES5_MAPPING_FILE="${TEST_DATA_DIR}/es5_shakespeare_mapping.json" | ||
ES6_MAPPING_FILE="${TEST_DATA_DIR}/es6_shakespeare_mapping.json" | ||
|
||
|
||
case "$ES_VERSION" in | ||
"") ;; | ||
|
||
"1.0.0") | ||
export ES_VERSION=1.0.0; | ||
export MAPPING_FILE=${LEGACY_MAPPING_FILE}; | ||
export ES_BINARY_URL="${ES1_ARCHIVE}/elasticsearch-$ES_VERSION.deb" | ||
;; | ||
|
||
"1.4.4") | ||
export ES_VERSION=1.4.4; | ||
export MAPPING_FILE=${LEGACY_MAPPING_FILE}; | ||
export ES_BINARY_URL="${ES1_ARCHIVE}/elasticsearch-$ES_VERSION.deb" | ||
;; | ||
|
||
"1.7.2") | ||
export ES_VERSION=1.7.2; | ||
export MAPPING_FILE=${LEGACY_MAPPING_FILE}; | ||
export ES_BINARY_URL="${ES1_ARCHIVE}/elasticsearch-$ES_VERSION.deb" | ||
;; | ||
|
||
"2.0.2") | ||
export ES_VERSION=2.0.2; | ||
export MAPPING_FILE=${LEGACY_MAPPING_FILE}; | ||
export ES_BINARY_URL="${ES2_ARCHIVE}/$ES_VERSION/elasticsearch-$ES_VERSION.deb" | ||
;; | ||
|
||
"2.1.2") | ||
export ES_VERSION=2.1.2; | ||
export MAPPING_FILE=${LEGACY_MAPPING_FILE}; | ||
export ES_BINARY_URL="${ES2_ARCHIVE}/$ES_VERSION/elasticsearch-$ES_VERSION.deb" | ||
;; | ||
|
||
"2.2.2") | ||
export ES_VERSION=2.2.2; | ||
export MAPPING_FILE=${LEGACY_MAPPING_FILE}; | ||
export ES_BINARY_URL="${ES2_ARCHIVE}/$ES_VERSION/elasticsearch-$ES_VERSION.deb" | ||
;; | ||
|
||
"2.3.5") | ||
export ES_VERSION=2.3.5; | ||
export MAPPING_FILE=${LEGACY_MAPPING_FILE}; | ||
export ES_BINARY_URL="${ES2_ARCHIVE}/$ES_VERSION/elasticsearch-$ES_VERSION.deb" | ||
;; | ||
|
||
"5.0.2") | ||
export ES_VERSION=5.0.2; | ||
export MAPPING_FILE=${ES5_MAPPING_FILE}; | ||
export ES_BINARY_URL="${ES5PLUS_ARCHIVE}/elasticsearch-$ES_VERSION.deb" | ||
;; | ||
|
||
"5.3.3") | ||
export ES_VERSION=5.3.3; | ||
export MAPPING_FILE=${ES5_MAPPING_FILE}; | ||
export ES_BINARY_URL="${ES5PLUS_ARCHIVE}/elasticsearch-$ES_VERSION.deb" | ||
;; | ||
|
||
"5.4.3") | ||
export ES_VERSION=5.4.3; | ||
export MAPPING_FILE=${ES5_MAPPING_FILE}; | ||
export ES_BINARY_URL="${ES5PLUS_ARCHIVE}/elasticsearch-$ES_VERSION.deb" | ||
;; | ||
|
||
"5.6.9") | ||
export ES_VERSION=5.6.9; | ||
export MAPPING_FILE=${ES5_MAPPING_FILE}; | ||
export ES_BINARY_URL="${ES5PLUS_ARCHIVE}/elasticsearch-$ES_VERSION.deb" | ||
;; | ||
|
||
"6.0.1") | ||
export ES_VERSION=6.0.1; | ||
export MAPPING_FILE=${ES6_MAPPING_FILE}; | ||
export ES_BINARY_URL="${ES5PLUS_ARCHIVE}/elasticsearch-$ES_VERSION.deb" | ||
;; | ||
|
||
"6.1.4") | ||
export ES_VERSION=6.1.4; | ||
export MAPPING_FILE=${ES5_MAPPING_FILE}; | ||
export ES_BINARY_URL="${ES5PLUS_ARCHIVE}/elasticsearch-$ES_VERSION.deb" | ||
;; | ||
|
||
"6.2.4") | ||
export ES_VERSION=6.2.4; | ||
export MAPPING_FILE=${ES5_MAPPING_FILE}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah here's the error (probably?), I used the wrong mapping file. Python tests didn't fail because there isn't a |
||
export ES_BINARY_URL="${ES5PLUS_ARCHIVE}/elasticsearch-$ES_VERSION.deb" | ||
;; | ||
esac | ||
|
||
# pull the binary | ||
curl -O ${ES_BINARY_URL} | ||
|
||
# start the service and wait a bit | ||
sudo dpkg \ | ||
-i \ | ||
--force-confnew \ | ||
elasticsearch-$ES_VERSION.deb | ||
sudo service elasticsearch start | ||
sleep ${SLEEP_TIL_STARTUP_SECONDS} | ||
sudo service elasticsearch status | ||
|
||
# seed ES with data | ||
mv ${MAPPING_FILE} shakespeare_mapping.json | ||
echo $(ls) | ||
|
||
curl -X PUT \ | ||
"${ES_HOST}/shakespeare" \ | ||
--silent \ | ||
-H 'Content-Type:application/json' \ | ||
-d @shakespeare_mapping.json | ||
|
||
curl -X PUT \ | ||
"${ES_HOST}/empty_index" \ | ||
--silent \ | ||
-H 'Content-Type:application/json' \ | ||
-d @shakespeare_mapping.json | ||
|
||
mv test_data/sample.json sample.json | ||
|
||
curl -X POST \ | ||
"${ES_HOST}/shakespeare/_bulk" \ | ||
--silent \ | ||
-H 'Content-Type:application/json' \ | ||
--data-binary @sample.json | ||
|
||
# test that the expected data made it | ||
curl -X POST \ | ||
"${ES_HOST}/_refresh" | ||
|
||
curl -X GET \ | ||
"${ES_HOST}/shakespeare/_search?size=1" \ | ||
-H 'Content-Type:application/json' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
# failure is a natural part of life | ||
set -e | ||
|
||
if [[ "$TASK" == "rpkg" ]]; then | ||
R_PACKAGE_DIR=$(pwd)/r-pkg | ||
R CMD build ${R_PACKAGE_DIR} | ||
R CMD check \ | ||
--as-cran \ | ||
*.tar.gz | ||
fi | ||
|
||
if [[ "$TASK" == "pypkg" ]]; then | ||
PY_PACKAGE_DIR=$(pwd)/py-pkg | ||
pytest \ | ||
--verbose \ | ||
${PY_PACKAGE_DI} | ||
fi |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
PY_PACKAGE_DIR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh good catch