Przeglądaj źródła

node container: automate the ruler script for non-mac hosts

Olivier Massot 3 lat temu
rodzic
commit
a5f323d5e1
2 zmienionych plików z 18 dodań i 3 usunięć
  1. 3 3
      docker/node/Dockerfile
  2. 15 0
      docker/node/entrypoint.sh

+ 3 - 3
docker/node/Dockerfile

@@ -23,6 +23,6 @@ RUN npm install npm@5.3.0; \
 
 RUN npm install;
 
-#CMD cd modules/ruler && jison -t rule.jison && babel --presets=es2015 model/**/*.js model/*.js -d lib && npm link && cd ../.. && npm link @opentalent/ruler \
-#    && node
-CMD node
+COPY ./docker/node/entrypoint.sh /home/entrypoint.sh
+RUN chmod +x /home/entrypoint.sh
+ENTRYPOINT ["/home/entrypoint.sh"]

+ 15 - 0
docker/node/entrypoint.sh

@@ -0,0 +1,15 @@
+#!/bin/bash
+
+unameOut="$(uname -s)"
+if [ "${unameOut}" != 'Darwin' ];then
+  # shellcheck disable=SC2164
+  cd /home/workspace/modules/ruler
+  jison -t rule.jison
+  babel --presets=es2015 model/**/*.js model/*.js -d lib
+  npm link
+  cd /home/workspace
+  npm link @opentalent/ruler;
+fi
+
+# This last line only intends to keep the docker alive
+tail -f /dev/null