1
1
#! /usr/bin/env bash
2
2
3
- set -euo pipefail
3
+ SOURCE_DIR= ` dirname " ${BASH_SOURCE[0]} " `
4
4
5
- echo " Removing existing container... "
5
+ source " $SOURCE_DIR /env-presto.sh "
6
6
7
- docker rm -fv presto 2> /dev/null || echo " Nothing to remove "
7
+ source " $SOURCE_DIR /common.sh "
8
8
9
- docker run -p 8080:8080 \
9
+ kill-existing ${CONTAINER_NAME}
10
+
11
+ docker run -p ${HOST_PORT} :8080 \
10
12
-p 8443:8443 \
11
- --name presto \
13
+ --name ${CONTAINER_NAME} \
12
14
--hostname presto \
13
15
--rm \
14
- -d metabase/presto-mb-ci
15
-
16
- SERVER_CA_PEM_FILE=/tmp/presto-ssl-ca.pem
17
- SERVER_CA_DER_FILE=/tmp/presto-ssl-ca.der
18
- MODIFIED_CACERTS_FILE=/tmp/cacerts-with-presto-ssl.jks
16
+ -d prestodb/presto:${PRESTO_VERSION}
19
17
20
18
cat << EOF
21
- Started Presto on port 8080 (insecure HTTP) and port 8443 (secure HTTPS) on the host machine
19
+
20
+ Started Presto on port ${HOST_PORT} (insecure HTTP) and port 8443 (secure HTTPS) on the host machine
22
21
23
22
To make the self signed certificate that was generated for this Presto instance available to your Java application
24
23
(ex: Metabase), perform the following steps after Presto is completely online. You can run
25
24
26
- docker logs --tail 5 presto
25
+ docker logs --tail 5 ${CONTAINER_NAME}
27
26
28
27
to see the current output. Once Presto is online, you will see a line containing something like the following:
29
28
@@ -44,4 +43,7 @@ also have the JAVA_HOME env var set for this all to work.
44
43
Finally, this can be made available to Metabase by adding the following JVM args when starting:
45
44
46
45
-Djavax.net.ssl.trustStore=$MODIFIED_CACERTS_FILE -Djavax.net.ssl.trustStorePassword=changeit
46
+
47
47
EOF
48
+
49
+ print-presto-vars
0 commit comments