Browse Source

Version bump

Joachim M. Giæver 3 years ago
parent
commit
ce8e17e4cf
2 changed files with 15 additions and 12 deletions
  1. 13 12
      snap/snapcraft.yaml
  2. 2 0
      src/helper/env-wrapper

+ 13 - 12
snap/snapcraft.yaml

@@ -1,6 +1,6 @@
 name: zwavejs2mqtt
 base: core20
-version: 'v5.8.0'
+version: 'v5.9.0'
 summary: Fully configurable Zwave to MQTT Gateway and Control Panel. 
 description: |
   - Configurable Zwave to Mqtt Gateway
@@ -48,7 +48,7 @@ apps:
       STORE_DIR: $SNAP_DATA
       ZWAVEJS_EXTERNAL_CONFIG: $SNAP_DATA/.ext-config
       DAEMONIZED: 1
-    command: lib/node_modules/yarn/bin/yarn --cwd $SNAP/lib/node_modules/zwavejs2mqtt --global-folder $SNAP/lib/node_modules/npm/node_modules start
+    command: lib/node_modules/yarn/bin/yarn start
     command-chain:
       - helper/env-wrapper
     plugs:
@@ -61,7 +61,7 @@ apps:
     environment:
       STORE_DIR: $SNAP_DATA
       ZWAVEJS_EXTERNAL_CONFIG: $SNAP_DATA/.ext-config
-    command: lib/node_modules/yarn/bin/yarn --cwd $SNAP/lib/node_modules/zwavejs2mqtt start
+    command: lib/node_modules/yarn/bin/yarn start
     command-chain:
       - helper/env-wrapper
     plugs:
@@ -95,6 +95,7 @@ parts:
     build-packages:
       - gcc
       - build-essential
+      - jq
     override-build: |
       set -x
       #sed -i 's/"zwave-js".*$/"zwave-js"\: "8.3.2-0-pr-3262-f5cdbca"/g' ${SNAPCRAFT_PART_BUILD}/package.json
@@ -102,8 +103,10 @@ parts:
       #   export GLOBAL_AGENT_HTTP_PROXY="${http_proxy}"
       #   export GLOBAL_AGENT_HTTPS_PROXY="${http_proxy}"
       # fi
-      yarn install
+      yarn --version
+      yarn install --immutable
       yarn run build \
+        && yarn remove $(cat $SNAPCRAFT_PART_INSTALL/package.json | jq -r '.devDependencies | keys | join(" ")') \
         && mkdir -p $SNAPCRAFT_PART_INSTALL/lib/node_modules \
         && cp --archive --link --no-dereference $SNAPCRAFT_PART_BUILD \
           $SNAPCRAFT_PART_INSTALL/lib/node_modules/zwavejs2mqtt \
@@ -113,29 +116,26 @@ parts:
     filesets:
       zwavejs2mqtt-include:
         - lib/node_modules/zwavejs2mqtt/.git
-        - lib/node_modules/zwavejs2mqtt/LICENSE
         - lib/node_modules/zwavejs2mqtt/*.md
+        - lib/node_modules/zwavejs2mqtt/LICENSE
         - lib/node_modules/zwavejs2mqtt/node_modules
         - lib/node_modules/zwavejs2mqtt/server
         - lib/node_modules/zwavejs2mqtt/package.json
+        - lib/node_modules/zwavejs2mqtt/.yarn
         - lib/node_modules/zwavejs2mqtt/yarn.lock
+        - lib/node_modules/zwavejs2mqtt/.yarnrc.yml
     stage:
       - $zwavejs2mqtt-include
-  pre-dependencies:
-    plugin: nil
-    build-environment:
-      - SNAPPY_STORE_NO_CDN: "1"
   dependencies:
-    after: [pre-dependencies]
     plugin: nil
     stage-snaps:
-      #- jq
+      - jq
       - yq
     stage-packages:
       - git
       - udev
       - rsync
-      - jq
+      - musl-dev
   nodejs:
     plugin: dump
     source:
@@ -147,6 +147,7 @@ parts:
         - libatomic1
     override-stage: |
       npm install --global yarn
+      yarn set version berry
       snapcraftctl stage
     organize:
       '*.md' : nodejs/

+ 2 - 0
src/helper/env-wrapper

@@ -113,4 +113,6 @@ fi
 export HOST="${SERVER_HOST}"
 export PORT="${SERVER_PORT}"
 
+cd "${SNAP}/lib/node_modules/zwavejs2mqtt"
+
 exec "$@"