Skip to content

Commit 820b0df

Browse files
julienbourdeauaseure
authored andcommitted
chore(travis): Get Algolia credentials from API Key Dealer
https://blog.algolia.com/travis-encrypted-variables-external-contributions/
1 parent 735048f commit 820b0df

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

.run-travis.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [[ "${JAVA_VERSION}" = "8" ]]; then
6+
if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [[ ! "$TRAVIS_PULL_REQUEST_SLUG" =~ ^algolia\/ ]]; then
7+
eval $(./algolia-keys export) && mvn clean test jacoco:report jacoco:report-aggregate -B && mvn -pl algoliasearch-tests coveralls:report -B;
8+
exit $?
9+
else
10+
mvn clean test jacoco:report jacoco:report-aggregate -B && mvn -pl algoliasearch-tests coveralls:report -B;
11+
exit $?
12+
fi
13+
fi
14+
15+
if [[ "${JAVA_VERSION}" = "9" ]]; then
16+
if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [[ ! "$TRAVIS_PULL_REQUEST_SLUG" =~ ^algolia\/ ]]; then
17+
eval $(./algolia-keys export) && mvn clean test;
18+
exit $?
19+
else
20+
mvn clean test;
21+
exit $?
22+
fi
23+
fi

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ cache:
1313

1414
#check coverage
1515
before_script:
16-
- "mvn com.coveo:fmt-maven-plugin:check"
16+
- "mvn com.coveo:fmt-maven-plugin:check"
17+
- wget https://alg.li/algolia-keys && chmod +x algolia-keys
1718

1819
script:
19-
- if [[ "${JAVA_VERSION}" = "8" ]]; then mvn clean test jacoco:report jacoco:report-aggregate -B && mvn -pl algoliasearch-tests coveralls:report -B; fi
20-
#Disable coverage for java9
21-
- if [[ "${JAVA_VERSION}" = "9" ]]; then mvn clean test; fi
20+
- ./.run-travis.sh
2221

2322
#deploy snapshots
2423
after_success:
25-
- "mvn clean deploy -DskipTests --settings settings-for-travis.xml"
24+
- "mvn clean deploy -DskipTests --settings settings-for-travis.xml"

0 commit comments

Comments
 (0)