Make possible to change settings via environment variables (#533)

This commit is contained in:
Shuya Tsukamoto 2017-05-27 02:28:05 +09:00 committed by Mars Lan
parent eefab3dc1e
commit 33e04a585a
5 changed files with 16 additions and 19 deletions

View File

@ -9,6 +9,7 @@
# #
# See http://www.playframework.com/documentation/latest/ApplicationSecret for more details. # See http://www.playframework.com/documentation/latest/ApplicationSecret for more details.
play.crypto.secret = "changeme" play.crypto.secret = "changeme"
play.crypto.secret = ${?PLAY_CRYPTO_SECRET}
# The application languages # The application languages
# ~~~~~ # ~~~~~
@ -57,5 +58,6 @@ db.wherehows.password = ${WHZ_DB_PASSWORD}
# if have this varialbe, only the id in this list will be scheduled # if have this varialbe, only the id in this list will be scheduled
# scheduler.jobid.whitelist=[1,2,3,4,5,6,7,8,9] # scheduler.jobid.whitelist=[1,2,3,4,5,6,7,8,9]
scheduler.check.interval=10 scheduler.check.interval=10
scheduler.check.interval=${?SCHEDULER_CHECK_INTERVAL}
# start the following list of kafka consumer etl jobs # start the following list of kafka consumer etl jobs
# kafka.consumer.etl.jobid=[44] # kafka.consumer.etl.jobid=[44]

View File

@ -14,9 +14,6 @@ mv backend-ser* backend-service
# rm -rf backend-service/share # rm -rf backend-service/share
rm backend-service/README.md rm backend-service/README.md
# leave the option to change the secret later.
sed -i 's/changeme/$PLAY_CRYPTO_SECRET/g' backend-service/conf/application.conf
tar zcvf backend-service.tar.gz backend-service tar zcvf backend-service.tar.gz backend-service
cp *.tar.gz ../../backend-service/archives cp *.tar.gz ../../backend-service/archives

View File

@ -15,16 +15,6 @@ mv wherehows-* wherehows
rm README.md rm README.md
# correct a few things that won't work in docker.
# leave the option to change the play crypto secret later.
sed -i 's/changeme/$PLAY_CRYPTO_SECRET/g' wherehows/conf/application.conf
# localhost usually does not work within docker, give people the power
# to change that from outside of docker with environment variables.
sed -i 's/localhost:8888/$HDFS_HOST:8888/g' wherehows/conf/application.conf
sed -i 's/localhost/$MYSQL_HOST/g' wherehows/conf/application.conf
tar zcvf web.tar.gz wherehows tar zcvf web.tar.gz wherehows
cp web.tar.gz ../../web/archives cp web.tar.gz ../../web/archives

View File

@ -13,8 +13,8 @@ services:
environment: environment:
WHZ_DB_USERNAME: wherehows WHZ_DB_USERNAME: wherehows
WHZ_DB_PASSWORD: wherehows WHZ_DB_PASSWORD: wherehows
WHZ_DB_URL: jdbc:mysql://mysql:3306/wherehows WHZ_DB_URL: jdbc:mysql://mysql:3306/wherehows?useUnicode=true&characterEncoding=utf8&verifyServerCertificate=false&useSSL=true
PLAY_CRYPTO_SECRET: changeme PLAY_CRYPTO_SECRET: please_change_in_production_environment
links: links:
- "mysql:mysql" - "mysql:mysql"
web: web:
@ -24,8 +24,7 @@ services:
environment: environment:
WHZ_DB_USERNAME: wherehows WHZ_DB_USERNAME: wherehows
WHZ_DB_PASSWORD: wherehows WHZ_DB_PASSWORD: wherehows
WHZ_DB_URL: jdbc:mysql://mysql:3306/wherehows WHZ_DB_URL: jdbc:mysql://mysql:3306/wherehows?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&verifyServerCertificate=false&useSSL=true
MYSQL_HOST: mysql PLAY_CRYPTO_SECRET: please_change_in_production_environment
HDFS_HOST: "127.0.0.1"
links: links:
- "mysql:mysql" - "mysql:mysql"

View File

@ -9,6 +9,7 @@
# #
# See http://www.playframework.com/documentation/latest/ApplicationSecret for more details. # See http://www.playframework.com/documentation/latest/ApplicationSecret for more details.
play.crypto.secret = "changeme" play.crypto.secret = "changeme"
play.crypto.secret = ${?PLAY_CRYPTO_SECRET}
# The application languages # The application languages
# ~~~~~ # ~~~~~
@ -44,13 +45,19 @@ play.i18n.langs = [ "en" ]
# play.evolutions.db.default.enabled=false # play.evolutions.db.default.enabled=false
datasets.tree.name = "/var/tmp/wherehows/resource/dataset.json" datasets.tree.name = "/var/tmp/wherehows/resource/dataset.json"
datasets.tree.name = ${?DATASETS_TREE_NAME}
flows.tree.name = "/var/tmp/wherehows/resource/flow.json" flows.tree.name = "/var/tmp/wherehows/resource/flow.json"
flows.tree.name = ${?FLOWS_TREE_NAME}
database.opensource.username = "wherehows" database.opensource.username = "wherehows"
database.opensource.username = ${?WHZ_DB_USERNAME}
database.opensource.password = "wherehows" database.opensource.password = "wherehows"
database.opensource.url = "jdbc:mysql://localhost/wherehows?charset=utf8&zeroDateTimeBehavior=convertToNull" database.opensource.password = ${?WHZ_DB_PASSWORD}
database.opensource.url = "jdbc:mysql://localhost/wherehows?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull"
database.opensource.url = ${?WHZ_DB_URL}
search.engine = "default" search.engine = "default"
search.engine = ${?YOUR_SEARCH_ENGINE}
elasticsearch.dataset.url = "$YOUR_DATASET_INDEX_URL" elasticsearch.dataset.url = "$YOUR_DATASET_INDEX_URL"
elasticsearch.flow.url = "$YOUR_FLOW_INDEX_URL" elasticsearch.flow.url = "$YOUR_FLOW_INDEX_URL"
@ -63,5 +70,7 @@ authentication.principal.domain = "$YOUR_LDAP_DOMAIN"
authentication.ldap.search.base = "$YOUR_LDAP_SEARCH_BASE" authentication.ldap.search.base = "$YOUR_LDAP_SEARCH_BASE"
dataset.hdfs_browser.link = "https://localhost:8888/filebrowser/#" dataset.hdfs_browser.link = "https://localhost:8888/filebrowser/#"
dataset.hdfs_browser.link = ${?YOUR_HDFS_BROWSER_LINK}
lineage.look.back.time = 60 lineage.look.back.time = 60
lineage.look.back.time = ${?LINEAGE_LOOK_BACK_TIME}