Try to fix Snap.

This commit is contained in:
Lauri Ojansivu 2022-06-16 00:56:54 +03:00
parent c48299c0dd
commit bd26ed7f7a
2 changed files with 62 additions and 35 deletions

View file

@ -0,0 +1,4 @@
#!/bin/bash
# List backups
ls -al $SNAP_COMMON/db-backups/

View file

@ -35,47 +35,56 @@ slots:
apps: apps:
wekan: wekan:
command: wekan-control command: ./bin/wekan-control
daemon: simple daemon: simple
plugs: [network, network-bind] plugs: [network, network-bind]
mongodb: mongodb:
command: mongodb-control command: ./bin/mongodb-control
daemon: simple daemon: simple
plugs: [network, network-bind] plugs: [network, network-bind]
caddy: caddy:
command: caddy-control command: ./bin/caddy-control
daemon: simple daemon: simple
plugs: [network, network-bind] plugs: [network, network-bind]
help: help:
command: wekan-help command: ./bin/wekan-help
database-backup: database-backup:
command: mongodb-backup command: ./bin/mongodb-backup
plugs: [network, network-bind] plugs: [network, network-bind]
database-list-backups: database-list-backups:
command: ls -al $SNAP_COMMON/db-backups/ command: ./bin/database-list-backups
database-restore: database-restore:
command: mongodb-restore command: ./bin/mongodb-restore
plugs: [network, network-bind] plugs: [network, network-bind]
parts: parts:
mongodb: mongodb:
source: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.8.tgz source: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.9.tgz
plugin: dump plugin: dump
stage-packages: stage-packages:
- libssl1.1 - libssl1.1
- libcurl3-dev - libcurl4
- libcurl4-openssl-dev - libstemmer0d
- zlib1g
- libsnappy1v5
- libyaml-cpp0.6
- libpcre3
- libpcrecpp0v5
- libboost-system1.71.0
- libboost-iostreams1.71.0
- libboost-filesystem1.71.0
- libboost-program-options1.71.0
- libgoogle-perftools4
filesets: filesets:
mongo: mongo:
- usr
- bin - bin
- lib - usr
stage: stage:
- $mongo - $mongo
prime: prime:
@ -106,7 +115,7 @@ parts:
- libfontconfig1 - libfontconfig1
override-build: | override-build: |
echo "Cleaning environment first" echo "Cleaning environment first"
rm -rf ~/.meteor ~/.npm /usr/local/lib/node_modules #rm -rf ~/.meteor ~/.npm /usr/local/lib/node_modules
rm -rf .build rm -rf .build
#echo "Using http npm packages so speedup install process https://stackoverflow.com/questions/39760113/callback-called-more-than-once-while-running-npm-install" #echo "Using http npm packages so speedup install process https://stackoverflow.com/questions/39760113/callback-called-more-than-once-while-running-npm-install"
#echo "registry=http://registry.npmjs.org/" > ~/.npmrc #echo "registry=http://registry.npmjs.org/" > ~/.npmrc
@ -116,32 +125,40 @@ parts:
#npm -g install node-gyp --unsafe-perm #npm -g install node-gyp --unsafe-perm
#npm -g install node-pre-gyp --unsafe-perm #npm -g install node-pre-gyp --unsafe-perm
#npm -g install fibers --unsafe-perm #npm -g install fibers --unsafe-perm
echo "Installing meteor" ##echo "Installing meteor"
curl https://install.meteor.com/ -o install_meteor.sh ##curl https://install.meteor.com/ -o install_meteor.sh
chmod +x install_meteor.sh ##chmod +x install_meteor.sh
sh install_meteor.sh ##sh install_meteor.sh
rm install_meteor.sh ##rm install_meteor.sh
#npm -g install meteor --unsafe-perm --allow-superuser #npm -g install meteor --unsafe-perm --allow-superuser
rm -rf .build #rm -rf .build
chmod u+w *.json ##chmod u+w *.json
npm install --unsafe-perm #npm install --unsafe-perm
meteor build .build --directory --allow-superuser ##npm install
##meteor build .build --directory --allow-superuser
# Remove legacy webbroser bundle, so that Wekan works also at Android Firefox, iOS Safari, etc. # Remove legacy webbroser bundle, so that Wekan works also at Android Firefox, iOS Safari, etc.
rm -rf .build/bundle/programs/web.browser.legacy ##rm -rf .build/bundle/programs/web.browser.legacy
# Change to directory .build/bundle/programs/server # Change to directory .build/bundle/programs/server
cd .build/bundle/programs/server ##cd .build/bundle/programs/server
chmod u+w *.json ##chmod u+w *.json
npm install --unsafe-perm #npm install --unsafe-perm
cd node_modules/fibers ##npm install
node build.js ##cd node_modules/fibers
cd ../../../../../.. ##node build.js
##cd ../../../../../..
# Cleanup # Cleanup
cd .build/bundle mkdir .build
find . -type d -name '*-garbage*' | xargs rm -rf cd .build
find . -name '*phantom*' | xargs rm -rf wget https://github.com/wekan/wekan/releases/download/v6.28/wekan-6.28-amd64.zip
find . -name '.*.swp' | xargs rm -f unzip wekan-6.28-amd64.zip
find . -name '*.swp' | xargs rm -f rm wekan-6.28-amd64.zip
cd ../.. cd ..
##cd .build/bundle
##find . -type d -name '*-garbage*' | xargs rm -rf
##find . -name '*phantom*' | xargs rm -rf
##find . -name '.*.swp' | xargs rm -f
##find . -name '*.swp' | xargs rm -f
##cd ../..
# Add fibers multi arch # Add fibers multi arch
#cd .build/bundle/programs/server/node_modules/fibers/bin #cd .build/bundle/programs/server/node_modules/fibers/bin
#curl https://releases.wekan.team/fibers-multi.7z -o fibers-multi.7z #curl https://releases.wekan.team/fibers-multi.7z -o fibers-multi.7z
@ -149,6 +166,12 @@ parts:
#rm fibers-multi.7z #rm fibers-multi.7z
#cd ../../../../../../.. #cd ../../../../../../..
# Copy to Snap # Copy to Snap
wget https://nodejs.org/dist/latest-v14.x/node-v14.19.3-linux-x64.tar.xz
tar -xf node-v14.19.3-linux-x64.tar.xz node-v14.19.3-linux-x64/bin/node
rm node-v14.19.3-linux-x64.tar.xz
mkdir $SNAPCRAFT_PART_INSTALL/bin
cp -p node-v14.19.3-linux-x64/bin/node $SNAPCRAFT_PART_INSTALL/bin/
rm -rf node-v14.19.3-linux-x64
cp -r .build/bundle/* $SNAPCRAFT_PART_INSTALL/ cp -r .build/bundle/* $SNAPCRAFT_PART_INSTALL/
cp .build/bundle/.node_version.txt $SNAPCRAFT_PART_INSTALL/ cp .build/bundle/.node_version.txt $SNAPCRAFT_PART_INSTALL/
rm -f $SNAPCRAFT_PART_INSTALL/lib/node_modules/wekan rm -f $SNAPCRAFT_PART_INSTALL/lib/node_modules/wekan