소스 검색

Fix build env and add instructions

Riccardo Balbo 3 년 전
부모
커밋
aa8197d308
3개의 변경된 파일34개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      .github/workflows/main.yml
  2. 30 0
      README.md
  3. 3 2
      make.sh

+ 1 - 1
.github/workflows/main.yml

@@ -14,7 +14,7 @@ jobs:
   build:
     runs-on: ubuntu-18.04    
     container:
-      image: riccardoblb/buildenvs:hugo
+      image: jmonkeyengine/buildenv-jme3:hugo
     
     steps: 
     - name: Clone master

+ 30 - 0
README.md

@@ -0,0 +1,30 @@
+# jMonkeyEngine Website
+
+## How to edit the website
+1. Open the folder with [Visual Studio Code](https://code.visualstudio.com/)
+2. Be sure to have the [Easy Less](https://marketplace.visualstudio.com/items?itemName=mrcrowl.easy-less) extension installed (this will autocompile less files on save)
+3. Edit the files you want
+4. Submit a PR to the source repo
+
+## How to test the website locally
+
+### With Docker
+The advantage of using Docker is that the script will pull a container with everything that is needed in order to run the website, if you chose this method you will need to have only a working [Docker installation](https://docs.docker.com/get-started/).
+
+To start an instance with docker, run
+   ```
+   RUNTIME="sudo docker" ./make.sh server
+   ```
+The instance will start and the http server will listen on http://localhost:1313
+
+
+### Without Docker
+If you can't or don't want to use Docker, the alternative is to launch the website manually. 
+ To do that you will need [hugo installed on your system](https://gohugo.io/), you can then choose to launch the instance using the helper script
+   ```
+   DONT_COMPILE_LESS=1 NO_CONTAINER=1 ./make.sh server
+   ```
+or directly with hugo if you are on a platform that doesn't support bash scripts
+```
+hugo server
+```

+ 3 - 2
make.sh

@@ -12,7 +12,7 @@
 set -x
 if [ "$IMAGE" = "" ];
 then
-    export IMAGE="riccardoblb/buildenvs:hugo"
+    export IMAGE="jmonkeyengine/buildenv-jme3:hugo"
 fi
 
 userUID=`id -u`
@@ -26,7 +26,7 @@ fi
 
 if [ "$DONT_COMPILE_LESS" = "" ];
 then
-    export CMD="sleep 2&&echo 'export default \"`date +%s`\"'> static/js/build-id.js&&npm install less -g&&lessc static/css/style.less static/css/style.css&&$CMD"    
+    export CMD="sleep 2&&echo 'export default \"`date +%s`\"'> static/js/build-id.js&&lessc static/css/style.less static/css/style.css&&$CMD"    
 fi
 
 
@@ -87,6 +87,7 @@ fi
 set -x
 if [ "$NO_CONTAINER" = "" ];
 then
+    $RUNTIME pull $IMAGE
     $RUNTIME run  -v"$PWD:$PWD" $ENV_FILE $RUN_AS -w $PWD $ARGS --rm $IMAGE bash -c  "$CMD"
 else
     eval "$CMD"