Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from trucemop/docker
Docker example update
- Loading branch information
Showing
12 changed files
with
199 additions
and
458 deletions.
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
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
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
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,4 @@ | ||
#!/bin/sh | ||
|
||
export SRC_DIR=/timely-server-src | ||
export TIMELY_DIR=/timely |
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 |
---|---|---|
@@ -1,6 +1,11 @@ | ||
#!/bin/sh | ||
|
||
WORKING="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
. "${WORKING}/deploy-env.sh" | ||
|
||
set -e | ||
/timely-server-src/bin/docker/deploy-timely-build.sh | ||
/timely/bin/timely-standalone.sh | ||
"${SRC_DIR}/bin/docker/genCerts.sh" | ||
"${SRC_DIR}/bin/docker/deploy-timely-build.sh" | ||
"${TIMELY_DIR}/bin/timely-standalone.sh" | ||
|
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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
WORKING="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
. "${WORKING}/deploy-env.sh" | ||
|
||
set -e | ||
tar xzf /timely-server-src/target/timely-server-$TIMELY_VERSION-dist.tar.gz -C /timely --strip-components 1 | ||
tar xzf "${SRC_DIR}/target/timely-server-$TIMELY_VERSION-dist.tar.gz" -C "${TIMELY_DIR}" --strip-components 1 | ||
|
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 |
---|---|---|
@@ -1,19 +1,57 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
/timely-server-src/bin/docker/deploy-timely-build.sh | ||
WORKING="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
. "${WORKING}/deploy-env.sh" | ||
|
||
/timely-server-src/bin/docker/wait-for-it.sh timely:54322 -t 45 | ||
"${SRC_DIR}/bin/docker/deploy-timely-build.sh" | ||
|
||
# create datasource in grafana | ||
#curl -X POST -u admin:admin -H "Content-Type: application/json" -d \ | ||
#'{"name":"Timely","type":"opentsdb","url":"https://timely:54322","access":"proxy","jsonData":{"tsdbVersion":1,"tsdbResolution":1}}' \ | ||
#http://grafana:3000/api/datasources | ||
|
||
# insert the dashboard | ||
#curl -X POST -u admin:admin -H "Content-Type: application/json" \ | ||
#-d @/timely-server-src/bin/docker/standalone_test.json \ | ||
#http://grafana:3000/api/dashboards/db | ||
"${SRC_DIR}/bin/docker/wait-for-it.sh" timely:54322 -t 45 | ||
|
||
/timely/bin/insert-test-data.sh | ||
|
||
# enable app | ||
curl -k -H "Content-Type: application/json" -d \ | ||
'{ | ||
"enabled":true | ||
}' \ | ||
https://admin:admin@grafana:3000/api/plugins/timely-app/settings | ||
|
||
# create data source | ||
curl -k -H "Content-Type: application/json" -d \ | ||
'{ | ||
"name":"Timely", | ||
"type":"timely-datasource", | ||
"Access":"direct", | ||
"jsonData": | ||
{ | ||
"timelyHost":"localhost", | ||
"httpsPort":"54322", | ||
"wsPort":"54323", | ||
"basicAuths":true | ||
} | ||
}' \ | ||
https://admin:admin@grafana:3000/api/datasources | ||
|
||
|
||
# import the dashboard | ||
curl -k -H "Content-Type: application/json" -d \ | ||
'{ | ||
"pluginId":"timely-datasource", | ||
"path":"dashboards/standalone_test.json", | ||
"overwrite":false, | ||
"inputs":[{ | ||
"name":"*", | ||
"type":"datasource", | ||
"pluginId":"timely-datasource", | ||
"value":"Timely" | ||
}] | ||
}' \ | ||
https://admin:admin@grafana:3000/api/dashboards/import | ||
|
||
# star the dashboard | ||
curl -k -X POST https://admin:admin@grafana:3000/api/user/stars/dashboard/1 | ||
|
||
"${TIMELY_DIR}/bin/insert-test-data.sh" | ||
|
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,56 @@ | ||
#!/bin/bash | ||
|
||
WORKING="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
. "${WORKING}/deploy-env.sh" | ||
|
||
PASSPREFIX=pass: | ||
KEYPASS=password | ||
export PASSWORD=$PASSPREFIX$KEYPASS | ||
|
||
if [ ! -d "${SRC_DIR}/pki" ]; then | ||
mkdir "${SRC_DIR}/pki" | ||
pushd "${SRC_DIR}/pki" | ||
|
||
#Create a private key | ||
|
||
openssl genrsa -aes256 -out CA.key -passout env:PASSWORD 4096 | ||
|
||
#Create a certificate request using the private key | ||
|
||
openssl req -x509 -new -key CA.key -sha256 -nodes -days 365 -out CA.pem -passin env:PASSWORD -subj '/C=US/ST=Confusion/L=Here/O=Timely/OU=Server/CN=localhost/emailAddress=noreply@localhost/subjectAltName=DNS.1=127.0.0.1' | ||
|
||
#Create your SSL material for Grafana | ||
|
||
#Create the private key for the Grafana server | ||
|
||
openssl genrsa -out grafana.key -passout env:PASSWORD 4096 | ||
|
||
#Generate a certificate signing request (CSR) with our Grafana private key | ||
|
||
openssl req -new -key grafana.key -sha256 -nodes -out grafana.csr -subj '/C=US/ST=Confusion/L=Here/O=Timely/OU=Server/CN=localhost/emailAddress=noreply@localhost/subjectAltName=DNS.1=127.0.0.1' | ||
|
||
#Use the CSR and the CA to create a certificate for the server (a reply to the CSR) | ||
|
||
openssl x509 -req -in grafana.csr -CA CA.pem -CAkey CA.key -CAcreateserial -out grafana.crt -days 365 -passin env:PASSWORD | ||
|
||
#Create your SSL material for Timely | ||
|
||
#Create the private key for the Timely server | ||
|
||
openssl genrsa -out timely.key 4096 | ||
|
||
#Generate a certificate signing request (CSR) with our Timely private key | ||
|
||
openssl req -new -key timely.key -sha256 -nodes -subj '/C=US/ST=Confusion/L=Here/O=Timely/OU=Server/CN=localhost/emailAddress=noreply@localhost/subjectAltName=DNS.1=127.0.0.1' > timely.csr | ||
|
||
#Use the CSR and the CA to create a certificate for the server (a reply to the CSR) | ||
|
||
openssl x509 -req -in timely.csr -CA CA.pem -CAkey CA.key -CAcreateserial -out timely.crt -days 365 -passin env:PASSWORD | ||
|
||
#Convert the private key to pkcs#8 format | ||
|
||
openssl pkcs8 -topk8 -inform PEM -outform PEM -in timely.key -out timely-pkcs8.key -passout env:PASSWORD | ||
popd | ||
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
Oops, something went wrong.