postgresql - 如何将 postgres 配置添加到 cordas build gradle deployNodes-task
问题描述
我想在 build-gradle 任务deployNodes
中将默认 h2-database 的配置替换为 postgres 实现
我想替换条目h2Port 10013
和
dataSourceProperties: {
dataSourceClassName: "org.postgresql.ds.PGSimpleDataSource",
dataSource.url: "jdbc:postgresql://localhost:5432/postgres_xyz?currentSchema=public",
dataSource.user: "xyz",
dataSource.password: "xyz",
dataSource.currentSchema: "public"
}
database: {
transactionIsolationLevel: "READ_COMMITTED"
}
我该怎么做/我可以使用哪种格式?
解决方案
build.gradle
您可以使用块在脚本中将 Postgresql DB 属性添加到您的节点配置中extraConfig=[ ... ]
,如下所示。
node {
...
extraConfig = [
dataSourceProperties: [
dataSourceClassName : "org.postgresql.ds.PGSimpleDataSource",
'dataSource.url' : "jdbc:postgresql://localhost:5432/nodedb",
'dataSource.user' : "postgres",
'dataSource.password' : "pa$$w0rd"
],
database: [
transactionIsolationLevel : "READ_COMMITTED"
]
]
}
推荐阅读
- google-apps-script - 我可以在 Google Apps 脚本上为每小时的特定时间设置每小时触发器吗?
- javascript - Angular 9:禁用属性在 chrome 和 IE 11 中的不同行为
- arrays - For 循环不会识别二维数组的名称
- ansible - 从 Ansible 中的 Ubuntu 密钥环中检索 Remmina 密码?
- javascript - 从在线 Power BI 仪表板中抓取数据
- python - 如何遍历 HTML 文件中的元素
- arrays - 我无法将值传递给下一个 ViewController
- java - 使用矢量时在 Java 中出现运算符错误
- python - 如何 AutoDoc 文档从函数 DocString 中排除 SQLAlchemy 库 DocString?
- ios - 如何在购买通知中为苹果设置测试和生产环境