From a0c7d87db35133c2a81d54766f0e718d7fe5f766 Mon Sep 17 00:00:00 2001 From: Eric Rasche Date: Fri, 4 Dec 2015 12:09:40 -0600 Subject: [PATCH 1/4] Ease the grunt uglify process --- Makefile | 19 +++++++++++++++++++ client/.docker-build.sh | 4 ++++ client/Dockerfile | 13 +++++++++++++ doc/source/dev/faq.rst | 11 +++++++++++ 4 files changed, 47 insertions(+) create mode 100644 Makefile create mode 100755 client/.docker-build.sh create mode 100644 client/Dockerfile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..40adf8778cb --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +GRUNT_DOCKER_NAME:=galaxy-client-builder + +all: + @echo "This makefile is used for building Galaxy's JS client. A sensible all action is not yet implemented" + +npm-deps: + cd client && npm install + +grunt: npm-deps + cd client && grunt + +grunt-docker-image: + docker build -t ${GRUNT_DOCKER_NAME} client + +grunt-docker: grunt-docker-image + docker run -it -v `pwd`:/data ${GRUNT_DOCKER_NAME} + +clean-grunt-docker-image: + docker rmi ${GRUNT_DOCKER_NAME} diff --git a/client/.docker-build.sh b/client/.docker-build.sh new file mode 100755 index 00000000000..7452b63adac --- /dev/null +++ b/client/.docker-build.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cd /data/client && \ + npm install && \ + grunt diff --git a/client/Dockerfile b/client/Dockerfile new file mode 100644 index 00000000000..132d7cd5c6b --- /dev/null +++ b/client/Dockerfile @@ -0,0 +1,13 @@ +FROM digitallyseamless/nodejs-bower-grunt +RUN mkdir /gx && \ + cd /gx && \ + wget https://github.com/galaxyproject/galaxy/archive/dev.tar.gz && \ + tar xvfz dev.tar.gz && \ + cd galaxy-dev/client && \ + npm install -g && \ + cd / && \ + rm -rf /gx + +WORKDIR /data/client +ADD ./.docker-build.sh /build.sh +CMD ["/build.sh"] diff --git a/doc/source/dev/faq.rst b/doc/source/dev/faq.rst index e60a0a9eea8..d7a43e4f1e4 100644 --- a/doc/source/dev/faq.rst +++ b/doc/source/dev/faq.rst @@ -10,3 +10,14 @@ to provide relatively concrete answers for specific Galaxy development scenarios This can be done with either IPython/Jupyter or a plain python console, depending on your preferences:: python -i scripts/db_shell.py + +... build Galaxy Javascript frontend client? +-------------------------------------------- + +We've added a makefile which will let you do this. If you have docker installed, you can simple run:: + + make grunt-docker + +Otherwise, you can run + + make grunt From 7cf98d32d811fbf9c8b64f72334c4f4c1e502882 Mon Sep 17 00:00:00 2001 From: Eric Rasche Date: Fri, 4 Dec 2015 13:36:01 -0600 Subject: [PATCH 2/4] Align opinions with @jmchilton --- doc/source/dev/faq.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/source/dev/faq.rst b/doc/source/dev/faq.rst index d7a43e4f1e4..7139678c0a3 100644 --- a/doc/source/dev/faq.rst +++ b/doc/source/dev/faq.rst @@ -14,10 +14,12 @@ This can be done with either IPython/Jupyter or a plain python console, dependin ... build Galaxy Javascript frontend client? -------------------------------------------- -We've added a makefile which will let you do this. If you have docker installed, you can simple run:: +We've added a makefile which will let you do this. If you have nodejs and npm installed, you can simple run:: + + make grunt + +If you prefer docker and aren't a JS developer primarily, you can run make grunt-docker -Otherwise, you can run - make grunt From 1295f985106a9440135e139368a708ef8dcc0538 Mon Sep 17 00:00:00 2001 From: Eric Rasche Date: Fri, 4 Dec 2015 13:36:10 -0600 Subject: [PATCH 3/4] Rename docker image --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 40adf8778cb..55dd9e26d8f 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -GRUNT_DOCKER_NAME:=galaxy-client-builder +GRUNT_DOCKER_NAME:=galaxy/client-builder:16.01 all: - @echo "This makefile is used for building Galaxy's JS client. A sensible all action is not yet implemented" + @echo "This makefile is primarily used for building Galaxy's JS client. A sensible all target is not yet implemented." npm-deps: cd client && npm install From 0fec39d3bd323b203d6221f087ccac8014c3fefc Mon Sep 17 00:00:00 2001 From: Eric Rasche Date: Fri, 4 Dec 2015 13:36:21 -0600 Subject: [PATCH 4/4] Less insane build recipe if it's included in the repo --- client/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/Dockerfile b/client/Dockerfile index 132d7cd5c6b..ad1a9c5884a 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,9 +1,9 @@ FROM digitallyseamless/nodejs-bower-grunt -RUN mkdir /gx && \ - cd /gx && \ - wget https://github.com/galaxyproject/galaxy/archive/dev.tar.gz && \ - tar xvfz dev.tar.gz && \ - cd galaxy-dev/client && \ +RUN mkdir /gx + +COPY package.json /gx/package.json + +RUN cd /gx && \ npm install -g && \ cd / && \ rm -rf /gx