Add build scripts.

This commit is contained in:
Lauri Ojansivu 2018-11-04 18:32:08 +02:00
parent 6f2275e8cb
commit 4c2857b6e8
34 changed files with 1013 additions and 0 deletions

12
releases/README.md Normal file
View file

@ -0,0 +1,12 @@
## Wekan release scripts
Sorry about the mess. I try to cleanup it sometime.
I usually use these:
- release.sh
- release-sandstorm.sh
- release-snap.sh
https://github.com/wekan/wekan-snap/wiki/Making-releases-from-source
https://github.com/wekan/wekan-maintainer/wiki/Building-Wekan-for-Sandstorm

5
releases/add-tag.sh Executable file
View file

@ -0,0 +1,5 @@
# Add tag to repo of new release
# Example: add-tag.sh v1.62
git tag -a $1 -m "$1"
git push origin $1

4
releases/commit.sh Executable file
View file

@ -0,0 +1,4 @@
# --- Add commit with showing editor where it's easy to add multiline commit
git commit
# ----

View file

@ -0,0 +1,3 @@
# https://makandracards.com/makandra/621-git-delete-a-branch-local-or-remote
#git push origin --delete feature-oauth
git push origin --delete $1

38
releases/rebuild-release.sh Executable file
View file

@ -0,0 +1,38 @@
#!/bin/bash
echo "Building Wekan."
cd ~/repos/wekan
rm -rf packages
mkdir -p ~/repos/wekan/packages
cd ~/repos/wekan/packages
git clone --depth 1 -b master https://github.com/wekan/flow-router.git kadira-flow-router
git clone --depth 1 -b master https://github.com/meteor-useraccounts/core.git meteor-useraccounts-core
git clone --depth 1 -b master https://github.com/wekan/meteor-accounts-cas.git
git clone --depth 1 -b master https://github.com/wekan/wekan-ldap.git
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "sed at macOS";
sed -i '' 's/api\.versionsFrom/\/\/api.versionsFrom/' ~/repos/wekan/packages/meteor-useraccounts-core/package.js
else
echo "sed at ${OSTYPE}"
sed -i 's/api\.versionsFrom/\/\/api.versionsFrom/' ~/repos/wekan/packages/meteor-useraccounts-core/package.js
fi
cd ~/repos/wekan
rm -rf node_modules
meteor npm install
rm -rf .build
meteor build .build --directory
cp -f fix-download-unicode/cfs_access-point.txt .build/bundle/programs/server/packages/cfs_access-point.js
#Removed binary version of bcrypt because of security vulnerability that is not fixed yet.
#https://github.com/wekan/wekan/commit/4b2010213907c61b0e0482ab55abb06f6a668eac
#https://github.com/wekan/wekan/commit/7eeabf14be3c63fae2226e561ef8a0c1390c8d3c
#cd ~/repos/wekan/.build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt
#rm -rf node_modules/bcrypt
#meteor npm install bcrypt
cd ~/repos/wekan/.build/bundle/programs/server
rm -rf node_modules
meteor npm install
#meteor npm install bcrypt
cd ~/repos
echo Building Wekan Done.

19
releases/release-cleanup.sh Executable file
View file

@ -0,0 +1,19 @@
# Usage: ./release.sh 1.36
# Delete old stuff
cd ~/
sudo rm -rf .npm
cd ~/repos/wekan
sudo rm -rf parts prime stage .meteor-spk
# Set permissions
cd ~/repos
sudo chown user:user wekan -R
cd ~/
sudo chown user:user .meteor -R
#sudo chown user:user .cache/snapcraft -R
sudo rm -rf .cache/snapcraft
sudo chown user:user .config -R
# Back
cd ~/repos

20
releases/release-sandstorm.sh Executable file
View file

@ -0,0 +1,20 @@
# Usage: ./release.sh 1.36
# Delete old stuff
cd ~/repos
./release-cleanup.sh
# Build Source
cd ~/repos
./rebuild-release.sh
# Build Sandstorm
cd ~/repos/wekan
meteor-spk pack wekan-$1.spk
spk publish wekan-$1.spk
scp wekan-$1.spk x2:/var/snap/wekan/common/releases.wekan.team/
mv wekan-$1.spk ..
# Delete old stuff
cd ~/repos
./release-cleanup.sh

26
releases/release-snap.sh Executable file
View file

@ -0,0 +1,26 @@
# Usage: ./release.sh 1.36
# Cleanup
cd ~/repos
./release-cleanup.sh
# Build Source
cd ~/repos
./rebuild-release.sh
# Build Snap
cd ~/repos/wekan
rm -rf packages
sudo snapcraft
# Cleanup
cd ~/repos
./release-cleanup.sh
# Push snap
cd ~/repos/wekan
sudo snap install --dangerous wekan_$1_amd64.snap
echo "Now you can test local installed snap."
snapcraft push wekan_$1_amd64.snap
scp wekan_$1_amd64.snap x2:/var/snap/wekan/common/releases.wekan.team/
mv wekan_$1_amd64.snap ..

9
releases/release.sh Executable file
View file

@ -0,0 +1,9 @@
# Usage: ./release.sh 1.36
# Build Sandstorm
cd ~/repos/wekan
./releases/release-sandstorm.sh $1
# Build Snap
cd ~/repos/wekan
./releases/release-snap.sh $1

1
releases/sandstorm-make-spk.sh Executable file
View file

@ -0,0 +1 @@
meteor-spk pack wekan-1.11.spk

1
releases/sandstorm-test-dev.sh Executable file
View file

@ -0,0 +1 @@
meteor-spk dev

2
releases/snap-edge.sh Executable file
View file

@ -0,0 +1,2 @@
# Change to snap edge
sudo snap refresh wekan --edge --amend

1
releases/snap-install.sh Executable file
View file

@ -0,0 +1 @@
sudo snap install --dangerous wekan_1.23-17-g9c94ea5_amd64.snap

1
releases/snap-push-to-store.sh Executable file
View file

@ -0,0 +1 @@
snapcraft push $1

2
releases/snap-stable.sh Executable file
View file

@ -0,0 +1,2 @@
# Change to snap stable
sudo snap refresh wekan --stable --amend

1
releases/snapcraft-help.sh Executable file
View file

@ -0,0 +1 @@
snapcraft help topics

View file

@ -0,0 +1,136 @@
cd ~/repos/wekan
echo "Arabic:"
tx pull -f -l ar
echo "Bulgarian:"
tx pull -f -l bg_BG
echo "Breton:"
tx pull -f -l br
echo "Catalan:"
tx pull -f -l ca
echo "Czech:"
tx pull -f -l cs
echo "Georgian:"
tx pull -f -l ka
echo "German:"
tx pull -f -l de
echo "Hindi:"
tx pull -f -l hi
echo "Esperanto:"
tx pull -f -l eo
echo "English (United Kingdom):"
tx pull -f -l en_GB
echo "Greek:"
tx pull -f -l el
echo "Spanish:"
tx pull -f -l es
echo "Spanish (Argentina):"
tx pull -f -l es_AR
echo "Basque:"
tx pull -f -l eu
echo "Persian:"
tx pull -f -l fa
echo "Finnish:"
tx pull -f -l fi
echo "French:"
tx pull -f -l fr
echo "Galician:"
tx pull -f -l gl
echo "Hebrew:"
tx pull -f -l he
echo "Hungarian:"
tx pull -f -l hu_HU
echo "Armenian:"
tx pull -f -l hy
echo "Indonesian (Indonesia):"
tx pull -f -l id_ID
echo "Igbo:"
tx pull -f -l ig
echo "Italian:"
tx pull -f -l it
echo "Japanese:"
tx pull -f -l ja
echo "Khmer:"
tx pull -f -l km
echo "Korean:"
tx pull -f -l ko
echo "Latvian (Latvia):"
tx pull -f -l lv_LV
echo "Mongolian (Mongolia):"
tx pull -f -l mn_MN
echo "Dutch:"
tx pull -f -l nl
echo "Norwegian:"
tx pull -f -l no
echo "Polish:"
tx pull -f -l pl
echo "Portuguese:"
tx pull -f -l pt
echo "Portuguese (Brazil):"
tx pull -f -l pt_BR
echo "Romanian (Romania):"
tx pull -f -l ro
echo "Russian:"
tx pull -f -l ru
echo "Serbian:"
tx pull -f -l sr
echo "Swedish:"
tx pull -f -l sv
echo "Tamil:"
tx pull -f -l ta
echo "Thai:"
tx pull -f -l th
echo "Turkish:"
tx pull -f -l tr
echo "Ukrainian:"
tx pull -f -l uk
echo "Vietnamese:"
tx pull -f -l vi
echo "Chinese (China):"
tx pull -f -l zh_CN
echo "Chinese (Taiwan)"
tx pull -f -l zh_TW

View file

@ -0,0 +1,2 @@
cd ~/repos/wekan
tx push -s

View file

@ -0,0 +1,6 @@
Wekan
-----
- NOTE: VirtualBox script use Wekan stable (master+devel branch). Edge scripts are at wekan-maintainer/releases/ directory.
- Wekan is started at boot at /etc/rc.local
- scripts are at ~/repos
- this README.txt is at VirtualBox Ubuntu desktop

View file

@ -0,0 +1,20 @@
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# node-allow-port-80.sh
sudo setcap cap_net_bind_service=+ep /usr/local/bin/node
# Start Wekan at boot at Ubuntu 14.04
sudo -H -u wekan bash -c '/home/wekan/repos/wekan/releases/virtualbox/start-wekan.sh'
exit 0

View file

@ -0,0 +1,2 @@
# ifdata -pa eth0
ip address

View file

@ -0,0 +1 @@
sudo setcap cap_net_bind_service=+ep /usr/local/bin/node

View file

@ -0,0 +1,42 @@
## Most of these are uncommented, because they are already installed.
#sudo rm -rf /usr/local/lib/node_modules
#sudo rm -rf ~/.npm
#sudo apt install build-essential c++ capnproto npm git curl
#sudo npm -g install n
#sudo n 4.8.6
#sudo npm -g install npm@4.6.1
#sudo npm -g install node-gyp
#sudo npm -g install node-pre-gyp
#sudo npm -g install fibers@1.0.15
sudo rm -rf wekan
git clone https://github.com/wekan/wekan
cd ~/repos
#curl https://install.meteor.com -o ./install_meteor.sh
#sed -i "s|RELEASE=.*|RELEASE=${METEOR_RELEASE}\"\"|g" ./install_meteor.sh
#echo "Starting meteor ${METEOR_RELEASE} installation... \n"
#chown wekan:wekan ./install_meteor.sh
#sh ./install_meteor.sh
mkdir -p ~/repos/wekan/packages
cd ~/repos/wekan/packages
rm -rf kadira-flow-router
rm -rf meteor-useraccounts-core
git clone https://github.com/wekan/flow-router.git kadira-flow-router
git clone https://github.com/meteor-useraccounts/core.git meteor-useraccounts-core
sed -i 's/api\.versionsFrom/\/\/api.versionsFrom/' ~/repos/wekan/packages/meteor-useraccounts-core/package.js
cd ~/repos/wekan
rm -rf node_modules
npm install
rm -rf .build
meteor build .build --directory
cp -f fix-download-unicode/cfs_access-point.txt .build/bundle/programs/server/packages/cfs_access-point.js
sed -i "s|build\/Release\/bson|browser_build\/bson|g" ~/repos/wekan/.build/bundle/programs/server/npm/node_modules/meteor/cfs_gridfs/node_modules/mongodb/node_modules/bson/ext/index.js
cd ~/repos/wekan/.build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt
rm -rf node_modules/bcrypt
meteor npm install --save bcrypt
cd ~/repos/wekan/.build/bundle/programs/server
rm -rf node_modules
npm install
meteor npm install --save bcrypt
cd ~/repos
echo Done.

View file

@ -0,0 +1,127 @@
#!/bin/bash
echo "Note: If you use other locale than en_US.UTF-8 , you need to additionally install en_US.UTF-8"
echo " with 'sudo dpkg-reconfigure locales' , so that MongoDB works correctly."
echo " You can still use any other locale as your main locale."
X64NODE="https://releases.wekan.team/node-v8.11.3-linux-x64.tar.gz"
function pause(){
read -p "$*"
}
echo
PS3='Please enter your choice: '
options=("Install Wekan dependencies" "Build Wekan" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Install Wekan dependencies")
if [[ "$OSTYPE" == "linux-gnu" ]]; then
echo "Linux";
if [ "$(grep -Ei 'buntu|mint' /etc/*release)" ]; then
sudo apt install -y build-essential git curl wget
sudo apt -y install nodejs npm
sudo npm -g install n
sudo n 8.11.3
fi
if [ "$(grep -Ei 'debian' /etc/*release)" ]; then
sudo apt install -y build-essential git curl wget
echo "Debian, or Debian on Windows Subsystem for Linux"
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt install -y nodejs
fi
# TODO: Add Sandstorm for version of Node.js install
#MACHINE_TYPE=`uname -m`
#if [ ${MACHINE_TYPE} == 'x86_64' ]; then
# # 64-bit stuff here
# wget ${X64NODE}
# sudo tar -C /usr/local --strip-components 1 -xzf ${X64NODE}
#elif [ ${MACHINE_TYPE} == '32bit' ]; then
# echo "TODO: 32-bit Linux install here"
# exit
#fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo "macOS";
pause '1) Install XCode 2) Install Node 8.x from https://nodejs.org/en/ 3) Press [Enter] key to continue.'
elif [[ "$OSTYPE" == "cygwin" ]]; then
# POSIX compatibility layer and Linux environment emulation for Windows
echo "TODO: Add Cygwin";
exit;
elif [[ "$OSTYPE" == "msys" ]]; then
# Lightweight shell and GNU utilities compiled for Windows (part of MinGW)
echo "TODO: Add msys on Windows";
exit;
elif [[ "$OSTYPE" == "win32" ]]; then
# I'm not sure this can happen.
echo "TODO: Add Windows";
exit;
elif [[ "$OSTYPE" == "freebsd"* ]]; then
echo "TODO: Add FreeBSD";
exit;
else
echo "Unknown"
echo ${OSTYPE}
exit;
fi
## Latest npm with Meteor 1.6
sudo npm -g install npm
sudo npm -g install node-gyp
# Latest fibers for Meteor 1.6
sudo npm -g install fibers@2.0.0
# Install Meteor, if it's not yet installed
curl https://install.meteor.com | bash
mkdir ~/repos
cd ~/repos
git clone https://github.com/wekan/wekan.git
cd wekan
git checkout devel
break
;;
"Build Wekan")
echo "Building Wekan."
cd ~/repos/wekan
mkdir -p ~/repos/wekan/packages
cd ~/repos/wekan/packages
git clone https://github.com/wekan/flow-router.git kadira-flow-router
git clone https://github.com/meteor-useraccounts/core.git meteor-useraccounts-core
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "sed at macOS";
sed -i '' 's/api\.versionsFrom/\/\/api.versionsFrom/' ~/repos/wekan/packages/meteor-useraccounts-core/package.js
else
echo "sed at ${OSTYPE}"
sed -i 's/api\.versionsFrom/\/\/api.versionsFrom/' ~/repos/wekan/packages/meteor-useraccounts-core/package.js
fi
cd ~/repos/wekan
rm -rf node_modules
meteor npm install
rm -rf .build
meteor build .build --directory
cp -f fix-download-unicode/cfs_access-point.txt .build/bundle/programs/server/packages/cfs_access-point.js
#Removed binary version of bcrypt because of security vulnerability that is not fixed yet.
#https://github.com/wekan/wekan/commit/4b2010213907c61b0e0482ab55abb06f6a668eac
#https://github.com/wekan/wekan/commit/7eeabf14be3c63fae2226e561ef8a0c1390c8d3c
#cd ~/repos/wekan/.build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt
#rm -rf node_modules/bcrypt
#meteor npm install bcrypt
cd ~/repos/wekan/.build/bundle/programs/server
rm -rf node_modules
meteor npm install
#meteor npm install bcrypt
cd ~/repos
echo Done.
break
;;
"Quit")
break
;;
*) echo invalid option;;
esac
done

View file

@ -0,0 +1,72 @@
# If you want to restart even on crash, uncomment while and done lines.
#while true; do
cd ~/repos/wekan/.build/bundle
export MONGO_URL='mongodb://127.0.0.1:27017/admin'
# ROOT_URL EXAMPLES FOR WEBSERVERS: https://github.com/wekan/wekan/wiki/Settings
# Production: https://example.com/wekan
# Local: http://localhost:3000
#export ipaddress=$(ifdata -pa eth0)
export ROOT_URL='http://localhost'
#---------------------------------------------
# Working email IS NOT REQUIRED to use Wekan.
# https://github.com/wekan/wekan/wiki/Adding-users
# https://github.com/wekan/wekan/wiki/Troubleshooting-Mail
# https://github.com/wekan/wekan-mongodb/blob/master/docker-compose.yml
export MAIL_URL='smtp://user:pass@mailserver.example.com:25/'
export MAIL_FROM='Wekan Support <support@example.com>'
# This is local port where Wekan Node.js runs, same as below on Caddyfile settings.
export PORT=80
#---------------------------------------------
# Wekan Export Board works when WITH_API='true'.
# If you disable Wekan API, Export Board does not work.
export WITH_API='true'
#---------------------------------------------
## Optional: Integration with Matomo https://matomo.org that is installed to your server
## The address of the server where Matomo is hosted:
# export MATOMO_ADDRESS='https://example.com/matomo'
export MATOMO_ADDRESS=''
## The value of the site ID given in Matomo server for Wekan
# export MATOMO_SITE_ID='123456789'
export MATOMO_SITE_ID=''
## The option do not track which enables users to not be tracked by matomo"
# export MATOMO_DO_NOT_TRACK='false'
export MATOMO_DO_NOT_TRACK='true'
## The option that allows matomo to retrieve the username:
# export MATOMO_WITH_USERNAME='true'
export MATOMO_WITH_USERNAME='false'
# Enable browser policy and allow one trusted URL that can have iframe that has Wekan embedded inside.
# Setting this to false is not recommended, it also disables all other browser policy protections
# and allows all iframing etc. See wekan/server/policy.js
# Default value: true
export BROWSER_POLICY_ENABLED=true
# When browser policy is enabled, HTML code at this Trusted URL can have iframe that embeds Wekan inside.
# Example: export TRUSTED_URL=http://example.com
export TRUSTED_URL=''
# What to send to Outgoing Webhook, or leave out. Example, that includes all that are default: cardId,listId,oldListId,boardId,comment,user,card,commentId .
# Example: export WEBHOOKS_ATTRIBUTES=cardId,listId,oldListId,boardId,comment,user,card,commentId
export WEBHOOKS_ATTRIBUTES=''
#---------------------------------------------
# OAuth2 docs: https://github.com/wekan/wekan/wiki/OAuth2
# OAuth2 Client ID, for example from Rocket.Chat. Example: abcde12345
# example: export OAUTH2_CLIENT_ID=abcde12345
export OAUTH2_CLIENT_ID=''
# OAuth2 Secret, for example from Rocket.Chat: Example: 54321abcde
# example: export OAUTH2_SECRET=54321abcde
export OAUTH2_SECRET=''
# OAuth2 Server URL, for example Rocket.Chat. Example: https://chat.example.com
# example: export OAUTH2_SERVER_URL=https://chat.example.com
export OAUTH2_SERVER_URL=''
# OAuth2 Authorization Endpoint. Example: /oauth/authorize
# example: export OAUTH2_AUTH_ENDPOINT=/oauth/authorize
export OAUTH2_AUTH_ENDPOINT=''
# OAuth2 Userinfo Endpoint. Example: /oauth/userinfo
# example: export OAUTH2_USERINFO_ENDPOINT=/oauth/userinfo
export OAUTH2_USERINFO_ENDPOINT=''
# OAuth2 Token Endpoint. Example: /oauth/token
# example: export OAUTH2_TOKEN_ENDPOINT=/oauth/token
export OAUTH2_TOKEN_ENDPOINT=''
#---------------------------------------------
node main.js & >> ~/repos/wekan.log
cd ~/repos
#done

View file

@ -0,0 +1 @@
pkill -f "node main.js"

1
releases/wekan-snap-help.sh Executable file
View file

@ -0,0 +1 @@
wekan.help | less