1

Add docker support

This commit is contained in:
2018-05-27 20:06:09 +03:00
parent 61db0a3869
commit 4e87b07d38
18 changed files with 234 additions and 84 deletions

View File

@@ -0,0 +1,22 @@
apply plugin: 'docker'
group 'com.devsoap'
dependencies {
compile project(':dbt-core')
runtime ratpack.dependency('h2')
runtime ratpack.dependency('jdbc-tx')
runtime 'org.slf4j:slf4j-simple:1.7.25'
}
run {
environment('RATPACK_DBT__LEDGER__REMOTE_URL', findProperty('ledgerURL').toString() ?: "http://localhost:5050/ledger")
environment('RATPACK_DBT__LEDGER__ENABLED', false)
}
distDocker {
registry = findProperty('dockerRegistry')
tagVersion = 'latest'
exposePort 5050
run.environment.each {key,value -> setEnvironment(key.toString(), value.toString())}
}

View File

@@ -0,0 +1,24 @@
import com.devsoap.dbt.DBTModule
import org.h2.jdbcx.JdbcDataSource
import org.slf4j.LoggerFactory
import javax.sql.DataSource
import static ratpack.groovy.Groovy.ratpack
def log = LoggerFactory.getLogger('dbt-executor')
ratpack {
serverConfig {
env()
sysProps()
}
bindings {
bindInstance(DataSource, new JdbcDataSource(url: 'jdbc:h2:mem:dbtdb;DB_CLOSE_DELAY=-1', user: ''))
module (DBTModule) { config ->
log.info "Executor available at $config.executor.remoteUrl"
log.info "Ledger available at $config.ledger.remoteUrl"
}
}
}