Переглянути джерело

HUE-8846 [doc] v1 with js, Python unit tests and js lint

Romain 6 роки тому
батько
коміт
c8318171f0

+ 29 - 7
.circleci/config.yml

@@ -9,7 +9,7 @@ jobs:
       # specify the version you desire here
       # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
       # - image: circleci/python:3.6.1
-      - image: gethue/hue-cci:1.0.0
+      - image: gethue/hue:latest
 
       # Specify service dependencies here if necessary
       # CircleCI maintains a library of pre-built images
@@ -44,12 +44,34 @@ jobs:
       - run:
           name: refresh sources
           command: |
-            cp -r desktop/core/src /usr/share/hue/desktop/core/src
-            cp -r desktop/libs /usr/share/hue/desktop/libs
-            cp -r apps /usr/share/hue/apps
-            cp -r docs /usr/share/hue/docs
-            make npm-install
-            make doc
+            rm -r /usr/share/hue/desktop/core/src/desktop
+            cp -r desktop/core/src/desktop /usr/share/hue/desktop/core/src/desktop
+
+            for lib in `ls desktop/libs`
+            do
+              rm -r /usr/share/hue/desktop/libs/$lib/src/$lib
+              cp -r desktop/libs/$lib/src/$lib /usr/share/hue/desktop/libs/$lib/src/$lib
+            done
+            for lib in `ls apps | grep -v Makefile`
+            do
+              rm -r /usr/share/hue/apps/$lib/src/$lib
+              cp -r apps/$lib/src/$lib /usr/share/hue/apps/$lib/src/$lib
+            done
+            # cp -r docs /usr/share/hue/docs
+
+            rm /usr/share/hue/desktop/conf/*.ini
+            cp desktop/conf/pseudo-distributed.ini.tmpl /usr/share/hue/desktop/conf/pseudo-distributed.ini
+
+            cd /usr/share/hue
+            # make npm-install # Not available
+            npm install
+            npm run webpack
+            npm run webpack-login
+            npm run webpack-workers
+            ./build/env/bin/hue collectstatic --noinput
+            
+            # make doc
+            # hugo --source docs/docs-site
 
       # Run tests
       - run:

+ 1 - 1
desktop/core/src/desktop/management/commands/test.py

@@ -34,7 +34,6 @@ import logging
 
 from desktop import appmanager
 from desktop.lib import django_mako
-from desktop.management.commands import test_windmill
 
 if six.PY3:
     from types import SimpleNamespace
@@ -148,6 +147,7 @@ class Command(BaseCommand):
     elif args[0] == "unit":
       nose_args = args + all_apps + ["-a", "!integration"]
     elif args[0] == "windmill":
+      from desktop.management.commands import test_windmill
       args = args[1:]
       ret = test_windmill.Command().handle(*args)
     elif args[0] in ("specific", "nose"):

+ 3 - 21
docs/docs-site/content/developer/development/_index.md

@@ -78,38 +78,20 @@ and possibly fix any issues it might report.
 
 ### Documentation
 
-New website:
-
-Install https://gohugo.io/getting-started/quick-start/.
+Install [Hugo](https://gohugo.io/getting-started/quick-start/).
 
 Develop:
 
     hugo serve
 
-Release:
-
-Make sure the base URL is correct:
-
-    cd docs/docs-site
-    vim config.toml
-    baseURL='http://cloudera.github.io/hue/docs-4.4.0/'
-
 Build the doc website:
 
     hugo
 
-Add it to the github page and push:
-
-    git checkout gh-pages
-    rm -r latest
-    cp ~/docs/docs-site/public latest -r
-
-    git push origin HEAD:gh-pages
-
+Release:
 
-Old documentation:
+    scp -r docs/docs-site/public/* root@docs.gethue.com:/var/www/docs.gethue.com
 
-    make docs
 
 ### CSS / LESS
 

+ 0 - 5
tools/docker/ci/Dockerfile

@@ -1,5 +0,0 @@
-# Welcome to Hue (http://gethue.com) Dockerfile
-# Build an image from a remote github or local cloned Hue repository.
-
-FROM gethue/hue:latest
-LABEL description="Hue Image for CI"

+ 0 - 8
tools/docker/ci/README.md

@@ -1,8 +0,0 @@
-
-## Build
-
-    docker build -t gethue/hue-cci:1.0.0 .
-
-## Push
-
-    docker push gethue/hue-cci:1.0.0

+ 5 - 5
tools/docker/hue/Dockerfile

@@ -33,6 +33,7 @@ RUN apt-get update -y && apt-get install -y \
   openssl \
   xmlsec1 \
   libxmlsec1-openssl \
+  hugo \
    && rm -rf /var/lib/apt/lists/*
 
 ADD . /hue
@@ -49,14 +50,13 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | sudo bash - \
 RUN PREFIX=/usr/share make install
 RUN useradd -ms /bin/bash hue && chown -R hue /usr/share/hue
 
+# Build the docs (not in Makefile yet)
+# RUN hugo --source docs/docs-site
+
 # Only keep install dir
-WORKDIR  /usr/share/hue
+WORKDIR /usr/share/hue
 RUN rm -rf /hue
 
-# Build the docs (not in Makefile yet)
-RUN snap install hugo
-RUN hugo --source docs/docs-site
-
 # Install DB connectors
 RUN ./build/env/bin/pip install psycopg2-binary
 

+ 4 - 4
tools/docker/hue/README.md

@@ -28,13 +28,13 @@ sudo docker build . -t hue -f tools/docker/hue/Dockerfile
 
 **Note**
 
-Feel free to replace `-t hue` in all the commands by your own docker repository and image tag, e.g. `gethue/hue:latest`
+Feel free to replace `-t hue` in all the commands by your own docker repository and image tag, e.g. `gethue/hue:latest`, `docker-account/hue:4.5.0`
 
 **Tag and push the image to the container registry**
 
 ```
-docker build . -t docker-registry.gethue.com/gethue/hue:4.4.0
-docker push docker-registry.gethue.com/gethue/hue:4.4.0
+docker build . -t gethue/hue:latest
+docker push docker.io/gethue/hue:latest
 ```
 
 
@@ -123,7 +123,7 @@ If for example the database is pointing to your localhost, if using Docker on Li
     sudo docker run -it -p 8888:8888 -v $PWD/desktop/conf/pseudo-distributed.ini:/usr/share/hue/desktop/conf/z-hue.ini --network="host" gethue/hue
 
 
-#### Docker Compose
+### Docker Compose
 
 Docker compose allows to start all the required services in one command line.