forked from prestodb/presto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
165 lines (150 loc) · 5.75 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
language: java
env:
global:
- MAVEN_OPTS="-Xmx512M -XX:+ExitOnOutOfMemoryError"
- MAVEN_SKIP_CHECKS_AND_DOCS="-Dair.check.skip-all=true -Dmaven.javadoc.skip=true"
- MAVEN_FAST_INSTALL="-DskipTests $MAVEN_SKIP_CHECKS_AND_DOCS -B -q -T C1"
- ARTIFACTS_UPLOAD_PATH_BRANCH=travis_build_artifacts/${TRAVIS_REPO_SLUG}/${TRAVIS_BRANCH}/${TRAVIS_BUILD_NUMBER}
- ARTIFACTS_UPLOAD_PATH_PR=travis_build_artifacts_pr/${TRAVIS_REPO_SLUG}/${TRAVIS_BRANCH}/${TRAVIS_BUILD_NUMBER}
- TEST_FLAGS=""
matrix:
- MAVEN_CHECKS=true
- TEST_SPECIFIC_MODULES=presto-tests
- TEST_SPECIFIC_MODULES=presto-tests TEST_FLAGS="-P ci-only"
- TEST_SPECIFIC_MODULES=presto-raptor
- TEST_SPECIFIC_MODULES=presto-accumulo
- TEST_SPECIFIC_MODULES=presto-cassandra
- TEST_SPECIFIC_MODULES=presto-hive
- TEST_OTHER_MODULES=!presto-tests,!presto-raptor,!presto-accumulo,!presto-cassandra,!presto-hive,!presto-docs,!presto-server,!presto-server-rpm
- PRODUCT_TESTS_BASIC_ENVIRONMENT=true
- PRODUCT_TESTS_SPECIFIC_ENVIRONMENT=true
- HIVE_TESTS=true
sudo: required
dist: trusty
group: deprecated-2017Q2
addons:
apt:
packages:
- oracle-java8-installer
cache:
directories:
- $HOME/.m2/repository
services:
- docker
install:
- ./mvnw -v
- |
if [[ -v TEST_SPECIFIC_MODULES ]]; then
./mvnw install $MAVEN_FAST_INSTALL -pl $TEST_SPECIFIC_MODULES -am
fi
- |
if [[ -v TEST_OTHER_MODULES ]]; then
./mvnw install $MAVEN_FAST_INSTALL -pl '!presto-docs,!presto-server,!presto-server-rpm'
fi
- |
if [[ -v PRODUCT_TESTS_BASIC_ENVIRONMENT || -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT ]]; then
./mvnw install $MAVEN_FAST_INSTALL -pl '!presto-docs,!presto-server-rpm'
fi
- |
if [[ -v HIVE_TESTS ]]; then
./mvnw install $MAVEN_FAST_INSTALL -pl presto-hive-hadoop2 -am
fi
before_script:
- |
export ARTIFACTS_UPLOAD_PATH=${ARTIFACTS_UPLOAD_PATH_BRANCH}
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
export ARTIFACTS_UPLOAD_PATH=${ARTIFACTS_UPLOAD_PATH_PR}
fi
script:
- |
if [[ -v MAVEN_CHECKS ]]; then
./mvnw install -DskipTests -B -T C1
fi
- |
if [[ -v TEST_SPECIFIC_MODULES ]]; then
./mvnw test $MAVEN_SKIP_CHECKS_AND_DOCS -B -pl $TEST_SPECIFIC_MODULES $TEST_FLAGS
fi
- |
if [[ -v TEST_OTHER_MODULES ]]; then
./mvnw test $MAVEN_SKIP_CHECKS_AND_DOCS -B -pl $TEST_OTHER_MODULES
fi
- |
if [[ -v PRODUCT_TESTS_BASIC_ENVIRONMENT ]]; then
presto-product-tests/bin/run_on_docker.sh \
multinode -x quarantine,big_query,storage_formats,profile_specific_tests,tpcds
fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT ]]; then
presto-product-tests/bin/run_on_docker.sh \
singlenode-kerberos-hdfs-impersonation -g storage_formats,cli,hdfs_impersonation,authorization
fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT ]]; then
presto-product-tests/bin/run_on_docker.sh \
singlenode-ldap -g ldap -x simba_jdbc
fi
# SQL server image sporadically hangs during the startup
# TODO: Uncomment it once issue is fixed
# https://github.com/Microsoft/mssql-docker/issues/76
# - |
# if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT ]]; then
# presto-product-tests/bin/run_on_docker.sh \
# singlenode-sqlserver -g sqlserver
# fi
- |
if [[ -v PRODUCT_TESTS_SPECIFIC_ENVIRONMENT ]]; then
presto-product-tests/bin/run_on_docker.sh \
multinode-tls -g smoke,cli,group-by,join,tls
fi
- |
if [[ -v HIVE_TESTS ]]; then
presto-hive-hadoop2/bin/run_on_docker.sh
fi
before_cache:
# Make the cache stable between builds by removing build output
- rm -rf $HOME/.m2/repository/com/facebook
notifications:
slack:
secure: V5eyoGShxFoCcYJcp858vf/T6gC9KeMxL0C1EElcpZRcKBrIVZzvhek3HLHxZOxlghqnvNVsyDtU3u5orkEaAXeXj5c2dN+4XBsAB9oeN5MtQ0Z3VLAhZDqKIW1LzcXrq4DpzM0PkGhjfjum/P94/qFYk0UckPtB6a341AuYRo8=
before_deploy:
- mkdir /tmp/artifacts
- cp -n presto-server/target/presto-server-*.tar.gz /tmp/artifacts
- cp -n presto-server-rpm/target/presto-server-rpm-*.x86_64.rpm /tmp/artifacts
- cp -n presto-product-tests/target/presto-product-tests-*-executable.jar /tmp/artifacts
- cp -n presto-jdbc/target/presto-jdbc-*.jar /tmp/artifacts
- cp -n presto-cli/target/presto-cli-*-executable.jar /tmp/artifacts
- echo $TRAVIS_COMMIT > /tmp/artifacts/git-revision.txt
- echo "<script>location='https://travis-ci.org/${TRAVIS_REPO_SLUG}/builds/${TRAVIS_BUILD_ID}'</script>"
> /tmp/artifacts/travis_build.html
- ls -lah /tmp/artifacts
deploy:
on:
all_branches: true
condition: -v DEPLOY_S3_ACCESS_KEY && -v MAVEN_CHECKS
provider: s3
access_key_id: ${DEPLOY_S3_ACCESS_KEY}
secret_access_key: ${DEPLOY_S3_SECRET_KEY}
bucket: ${DEPLOY_S3_BUCKET}
skip_cleanup: true
local-dir: /tmp/artifacts
upload-dir: ${ARTIFACTS_UPLOAD_PATH}
acl: public_read
after_script:
- |
if [[ -v DEPLOY_S3_ACCESS_KEY ]]; then
sudo pip install awscli
export AWS_ACCESS_KEY_ID=${DEPLOY_S3_ACCESS_KEY}
export AWS_SECRET_ACCESS_KEY=${DEPLOY_S3_SECRET_KEY}
JOB_ARTIFACTS_URL_PREFIX=s3://${DEPLOY_S3_BUCKET}/${ARTIFACTS_UPLOAD_PATH}/travis_jobs/${TRAVIS_JOB_NUMBER}-run
JOB_RUN_ATTEMPTS=$( aws s3 ls ${JOB_ARTIFACTS_URL_PREFIX} | wc -l | tr -d '[:space:]' )
JOB_STATUS=$( [ "$TRAVIS_TEST_RESULT" == "0" ] && echo SUCCESS || echo FAILURE )
mkdir -p /tmp/job_artifacts/
rsync -av -m \
--include='**/' \
--include='**/surefire-reports/**.xml' \
--include='**/surefire-reports/emailable-report.html' \
--exclude='*' \
. /tmp/job_artifacts/
wget https://api.travis-ci.org/jobs/${TRAVIS_JOB_ID}/log.txt?deansi=true -O /tmp/job_artifacts/log.txt
aws s3 sync /tmp/job_artifacts ${JOB_ARTIFACTS_URL_PREFIX}_$((JOB_RUN_ATTEMPTS + 1))-${JOB_STATUS} --quiet
fi