diff --git a/.circleci/snap.sh b/.circleci/snap.sh index cd733d85209ee..38850daa19381 100644 --- a/.circleci/snap.sh +++ b/.circleci/snap.sh @@ -18,6 +18,7 @@ git clone -b $SNAP_CHANNEL git+ssh://rocket.chat.buildmaster@git.launchpad.net/r # Rarely will change, but just incase we copy it all cp -r resources buildinfo launchpad/ sed s/#{RC_VERSION}/$RC_VERSION/ snapcraft.yaml > launchpad/snapcraft.yaml +sed s/#{RC_VERSION}/$RC_VERSION/ resources/prepareRocketChat > launchpad/resources/prepareRocketChat cd launchpad git add resources snapcraft.yaml buildinfo diff --git a/.snapcraft/resources/prepareRocketChat b/.snapcraft/resources/prepareRocketChat new file mode 100755 index 0000000000000..882998b9f82a8 --- /dev/null +++ b/.snapcraft/resources/prepareRocketChat @@ -0,0 +1,18 @@ +#!/bin/bash + +curl -SLf "https://releases.rocket.chat/#{RC_VERSION}/download/" -o rocket.chat.tgz + +tar xvf rocket.chat.tgz --strip 1 + +cd programs/server + +npm install + +# Ideally this will go away. For some reason on install its installing node-v57-linux-x64-glibc but when actually running it is looking for node-v57-linux-x64-unknown +if [[ $(uname -m) == "x86_64" ]] +then + cp -r npm/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc npm/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-unknown +fi + +# sharp needs execution stack removed - https://forum.snapcraft.io/t/snap-and-executable-stacks/1812 +execstack --clear-execstack npm/node_modules/sharp/vendor/lib/librsvg-2.so.2.42.0 diff --git a/.snapcraft/snapcraft.yaml b/.snapcraft/snapcraft.yaml index 5674b4764bee9..df80e0ed5069b 100644 --- a/.snapcraft/snapcraft.yaml +++ b/.snapcraft/snapcraft.yaml @@ -49,17 +49,15 @@ parts: build-packages: - curl plugin: dump - prepare: curl -SLf "https://releases.rocket.chat/#{RC_VERSION}/download/" -o rocket.chat.tgz; tar xvf rocket.chat.tgz --strip 1; cd programs/server; npm install; npm install grpc@1.6.6; + prepare: ./resources/prepareRocketChat after: [node] source: . stage-packages: - - graphicsmagick + - execstack stage: - programs - main.js - .node_version.txt - - usr - - lib mongodb: build-packages: - wget