-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide docker-web project for gradle, restructure web static content
- Loading branch information
Showing
13 changed files
with
122 additions
and
94 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import io.deephaven.tools.License | ||
|
||
plugins { | ||
id 'com.bmuschko.docker-remote-api' | ||
} | ||
|
||
configurations { | ||
js | ||
} | ||
dependencies { | ||
js project(path: ':web', targetConfiguration: 'js') | ||
} | ||
|
||
evaluationDependsOn Docker.registryProject('nginx-base') | ||
|
||
def dockerLicenses = License.createFrom(project).syncDockerLicense() | ||
|
||
def syncDir = layout.buildDirectory.dir('docker') | ||
def prepareDocker = project.tasks.register('prepareDocker', Sync) { | ||
from layout.projectDirectory.dir('src/main/docker') | ||
from(configurations.js) { | ||
into 'static' | ||
} | ||
from (dockerLicenses.get().outputs) { | ||
into 'licenses' | ||
} | ||
into syncDir | ||
} | ||
|
||
Docker.registerDockerImage(project, 'buildDocker') { | ||
inputDir.set syncDir | ||
inputs.files Docker.registryFiles(project, 'nginx-base') | ||
inputs.files prepareDocker.get().outputs.files | ||
images.add('deephaven/web:local-build') | ||
} | ||
|
||
assemble.dependsOn buildDocker |
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,10 @@ | ||
FROM deephaven/nginx-base:local-build | ||
|
||
COPY licenses/ / | ||
COPY nginx/default.conf /etc/nginx/conf.d/ | ||
COPY nginx/nginx.conf /etc/nginx/ | ||
COPY nginx/99-init-notebooks.sh /docker-entrypoint.d | ||
|
||
COPY static/ /usr/share/nginx/html | ||
|
||
VOLUME /tmp |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,57 +1,37 @@ | ||
import io.deephaven.tools.License | ||
|
||
plugins { | ||
id 'com.bmuschko.docker-remote-api' | ||
} | ||
|
||
evaluationDependsOn ':web-client-ui' | ||
evaluationDependsOn ':proto:raw-js-openapi' | ||
evaluationDependsOn Docker.registryProject('nginx-base') | ||
|
||
apply from: "$rootDir/gradle/web-client.gradle" | ||
|
||
configurations { | ||
js | ||
} | ||
|
||
dependencies { | ||
compile project(':web-client-api') | ||
compile project(':open-api-lang-parser') | ||
|
||
js project(path: ':proto:raw-js-openapi', configuration: 'js') | ||
} | ||
|
||
GwtTools.gwtCompile project, 'io.deephaven.ide.DeephavenIde', 'Create a jar of javascript for web IDE' | ||
|
||
// deephaven/dhide | ||
Task dhide = project(':web-client-ui').tasks.findByName('ideClientMakeImage') | ||
|
||
// deephaven/js-out | ||
Task jsOut = project(':proto:raw-js-openapi').tasks.findByName('webpackSourcesMakeImage') | ||
|
||
Task gwtc = tasks.getByName('gwtCompile') | ||
|
||
def dockerLicenses = License.createFrom(project).syncDockerLicense() | ||
|
||
def prepareDocker = project.tasks.register('prepareDocker', Sync) { | ||
// TODO(deephaven-core#1596): Remove extra dependencies for build-ci.yml | ||
// Note: GH actions currently prepares docker via gradle, but does its own building via | ||
// a native GH action. As such, we need to make sure that the prepare also invokes the | ||
// necessarily build pre-reqs. If GH actions eventually calls buildDocker instead, we | ||
// can remove these dependencies. | ||
inputs.files([dhide, jsOut].each { t -> t.outputs.files }) | ||
inputs.files Docker.registryFiles(project, 'nginx-base') | ||
|
||
into "${buildDir}/docker" | ||
from(gwtc.outputs.files) { | ||
include("dhapi/**") | ||
def jsOutput = layout.buildDirectory.dir('js') | ||
def gwtOutput = tasks.register('gwtOutput', Sync) { | ||
includeEmptyDirs = false | ||
from(tasks.getByName('gwtCompile').outputs.files) { | ||
// only copy the dhapi module, and don't give it a wrapper directory | ||
include 'dhapi/**' | ||
eachFile { it.path = 'jsapi/' + it.path.substring('dhapi/'.length()) } | ||
} | ||
from (dockerLicenses.get().outputs) { | ||
into 'licenses' | ||
} | ||
from 'docker/Dockerfile' | ||
from 'nginx/default.conf' | ||
from 'nginx/nginx.conf' | ||
from 'nginx/99-init-notebooks.sh' | ||
into jsOutput | ||
} | ||
|
||
Docker.registerDockerImage(project, 'buildDocker') { | ||
inputs.files([prepareDocker.get(), dhide, jsOut].each { t -> t.outputs.files }) | ||
inputs.files Docker.registryFiles(project, 'nginx-base') | ||
//buildArgs.put('DEEPHAVEN_VERSION', "${project.version}") | ||
images.add('deephaven/web:local-build') | ||
artifacts { | ||
js(jsOutput) { | ||
builtBy gwtOutput | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
configurations { | ||
js | ||
jsJar { | ||
transitive = false | ||
} | ||
} | ||
|
||
dependencies { | ||
js project(path: ':web-client-ui', configuration: 'js') | ||
js project(path: ':web-client-ide', configuration: 'js') | ||
} | ||
|
||
/** | ||
* Provides a jar full of static js/html/css that can be served from jetty | ||
*/ | ||
def ideClientJsJar = tasks.register('ideClientJsJar', Jar) { | ||
archivesBaseName = "deephaven-web" | ||
from configurations.js | ||
} | ||
|
||
artifacts { | ||
jsJar ideClientJsJar | ||
js layout.buildDirectory.dir('empty') | ||
} |