release for windows
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@ -2,9 +2,9 @@
|
|||||||
pkg
|
pkg
|
||||||
bin2
|
bin2
|
||||||
bin/i18n
|
bin/i18n
|
||||||
bin/leanote-linux
|
bin/leanote*
|
||||||
bin/leanote-mac
|
|
||||||
bin/release
|
bin/release
|
||||||
|
bin/test.sh
|
||||||
bin/tmp
|
bin/tmp
|
||||||
bin/test
|
bin/test
|
||||||
bin/src
|
bin/src
|
||||||
|
10
app/init.go
10
app/init.go
@ -10,8 +10,8 @@ import (
|
|||||||
"github.com/leanote/leanote/app/controllers/admin"
|
"github.com/leanote/leanote/app/controllers/admin"
|
||||||
"github.com/leanote/leanote/app/controllers/member"
|
"github.com/leanote/leanote/app/controllers/member"
|
||||||
_ "github.com/leanote/leanote/app/lea/binder"
|
_ "github.com/leanote/leanote/app/lea/binder"
|
||||||
"github.com/leanote/leanote/app/lea/session"
|
// "github.com/leanote/leanote/app/lea/session"
|
||||||
"github.com/leanote/leanote/app/lea/memcache"
|
// "github.com/leanote/leanote/app/lea/memcache"
|
||||||
"github.com/leanote/leanote/app/lea/route"
|
"github.com/leanote/leanote/app/lea/route"
|
||||||
"reflect"
|
"reflect"
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -33,11 +33,11 @@ func init() {
|
|||||||
// AuthFilter, // Invoke the action.
|
// AuthFilter, // Invoke the action.
|
||||||
revel.FilterConfiguringFilter, // A hook for adding or removing per-Action filters.
|
revel.FilterConfiguringFilter, // A hook for adding or removing per-Action filters.
|
||||||
revel.ParamsFilter, // Parse parameters into Controller.Params.
|
revel.ParamsFilter, // Parse parameters into Controller.Params.
|
||||||
// revel.SessionFilter, // Restore and write the session cookie.
|
revel.SessionFilter, // Restore and write the session cookie.
|
||||||
|
|
||||||
// 使用SessionFilter标准版从cookie中得到sessionID, 然后通过MssessionFilter从Memcache中得到
|
// 使用SessionFilter标准版从cookie中得到sessionID, 然后通过MssessionFilter从Memcache中得到
|
||||||
// session, 之后MSessionFilter将session只存sessionID然后返回给SessionFilter返回到web
|
// session, 之后MSessionFilter将session只存sessionID然后返回给SessionFilter返回到web
|
||||||
session.SessionFilter, // leanote session
|
// session.SessionFilter, // leanote session
|
||||||
// session.MSessionFilter, // leanote memcache session
|
// session.MSessionFilter, // leanote memcache session
|
||||||
|
|
||||||
revel.FlashFilter, // Restore and write the flash cookie.
|
revel.FlashFilter, // Restore and write the flash cookie.
|
||||||
@ -367,7 +367,7 @@ func init() {
|
|||||||
// email配置
|
// email配置
|
||||||
InitEmail()
|
InitEmail()
|
||||||
InitVd()
|
InitVd()
|
||||||
memcache.InitMemcache() // session服务
|
// memcache.InitMemcache() // session服务
|
||||||
// 其它service
|
// 其它service
|
||||||
service.InitService()
|
service.InitService()
|
||||||
controllers.InitService()
|
controllers.InitService()
|
||||||
|
@ -44,7 +44,7 @@ function log(o) {
|
|||||||
-->
|
-->
|
||||||
<li><a href="/index#download" target="#download" class="smooth-scroll">{{msg . "download"}}</a> </li>
|
<li><a href="/index#download" target="#download" class="smooth-scroll">{{msg . "download"}}</a> </li>
|
||||||
<li><a href="/index#donate" target="#donate" class="smooth-scroll">{{msg . "donate"}}</a> </li>
|
<li><a href="/index#donate" target="#donate" class="smooth-scroll">{{msg . "donate"}}</a> </li>
|
||||||
<li><a id="leanoteBlog" href="{{.leaUrl}}/index" target="_blank" title="lea++, leanote博客平台" class="">lea++</a></li>
|
<li><a id="leanoteBlog" href="http://lea.leanote.com" target="_blank" title="lea++, leanote博客平台" class="">lea++</a></li>
|
||||||
<li style="position: relative; margin-right: 3px;">
|
<li style="position: relative; margin-right: 3px;">
|
||||||
<a href="http://bbs.leanote.com" target="_blank" class="">{{msg . "discussion"}}</a>
|
<a href="http://bbs.leanote.com" target="_blank" class="">{{msg . "discussion"}}</a>
|
||||||
<div class="red-circle" style=""></div>
|
<div class="red-circle" style=""></div>
|
||||||
@ -92,7 +92,6 @@ function log(o) {
|
|||||||
|
|
||||||
<ul id="blogNav" class="pull-right">
|
<ul id="blogNav" class="pull-right">
|
||||||
<li><a href="/index#" target="body" class="smooth-scroll">{{msg . "home"}}</a></li>
|
<li><a href="/index#" target="body" class="smooth-scroll">{{msg . "home"}}</a></li>
|
||||||
<li><a href="/index#download" target="#download" class="smooth-scroll">{{msg . "download"}}</a> </li>
|
|
||||||
<li><a href="/index#donate" target="#donate" class="smooth-scroll">{{msg . "donate"}}</a> </li>
|
<li><a href="/index#donate" target="#donate" class="smooth-scroll">{{msg . "donate"}}</a> </li>
|
||||||
<li><a id="leanoteBlog" href="{{.leaUrl}}/index" target="_blank" title="lea++, leanote博客平台" class="">lea++</a></li>
|
<li><a id="leanoteBlog" href="{{.leaUrl}}/index" target="_blank" title="lea++, leanote博客平台" class="">lea++</a></li>
|
||||||
<li style="position: relative; margin-right: 3px;">
|
<li style="position: relative; margin-right: 3px;">
|
||||||
|
@ -66,20 +66,6 @@
|
|||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<div class="container" id="download">
|
|
||||||
<h2 style="margin: 20px 0;text-align: center;">{{msg . "download"}}</h2>
|
|
||||||
<div class="row">
|
|
||||||
<div style="width:300px; margin:auto; padding: 10px;">
|
|
||||||
Linux : <a href="https://github.com/leanote/leanote/releases/download/0.4/leanote-linux-v0.4.bin.tar.gz">leanote-linux-v0.4.bin.tar.gz</a> <br />
|
|
||||||
MacOS X : <a href="https://github.com/leanote/leanote/releases/download/0.4/leanote-mac-v0.4.bin.tar.gz">leanote-mac-v0.4.bin.tar.gz</a> <br />
|
|
||||||
<br />
|
|
||||||
<a href="https://github.com/leanote/leanote#3-how-to-install-leanote">{{msg . "howToInstallLeanote"}}</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<div class="container" id="donate">
|
<div class="container" id="donate">
|
||||||
<h2 style="margin: 20px 0;text-align: center;">{{msg . "donate"}}</h2>
|
<h2 style="margin: 20px 0;text-align: center;">{{msg . "donate"}}</h2>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -64,20 +64,6 @@
|
|||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<div class="container" id="download">
|
|
||||||
<h2 style="margin: 20px 0;text-align: center;">{{msg . "download"}}</h2>
|
|
||||||
<div class="row">
|
|
||||||
<div style="width:300px; margin:auto; padding: 10px;">
|
|
||||||
Linux : <a href="https://github.com/leanote/leanote/releases/download/0.4/leanote-linux-v0.4.bin.tar.gz">leanote-linux-v0.4.bin.tar.gz</a> <br />
|
|
||||||
MacOS X : <a href="https://github.com/leanote/leanote/releases/download/0.4/leanote-mac-v0.4.bin.tar.gz">leanote-mac-v0.4.bin.tar.gz</a> <br />
|
|
||||||
<br />
|
|
||||||
<a href="https://github.com/leanote/leanote#3-how-to-install-leanote">{{msg . "howToInstallLeanote"}}</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<div class="container" id="donate">
|
<div class="container" id="donate">
|
||||||
<h2 style="margin: 20px 0;text-align: center;">{{msg . "donate"}}</h2>
|
<h2 style="margin: 20px 0;text-align: center;">{{msg . "donate"}}</h2>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
130
bin/release.sh
130
bin/release.sh
@ -2,40 +2,79 @@
|
|||||||
|
|
||||||
# release leanote
|
# release leanote
|
||||||
|
|
||||||
|
# 当前路径
|
||||||
SP=$(cd "$(dirname "$0")"; pwd)
|
SP=$(cd "$(dirname "$0")"; pwd)
|
||||||
|
|
||||||
cd $SP
|
|
||||||
cd ../
|
|
||||||
|
|
||||||
# tmp path to store leanote release files
|
# tmp path to store leanote release files
|
||||||
tmp="/Users/life/Desktop/leanote_release"
|
tmp="/Users/life/Desktop/leanote_release"
|
||||||
|
|
||||||
version=x86_64.v1.0-beta.2
|
# version
|
||||||
|
V="v1.0-beta.4"
|
||||||
|
|
||||||
|
##=================================
|
||||||
|
# 1. 先build 成 3个平台, 2种bit = 6种
|
||||||
|
##=================================
|
||||||
|
|
||||||
|
# cd /Documents/Go/package2/src/github.com/leanote/leanote/bin
|
||||||
|
# GOOS=darwin GOARCH=amd64 go build -o leanote-darwin-amd64 ../app/tmp
|
||||||
|
|
||||||
|
cd $SP
|
||||||
|
|
||||||
|
# $1 = darwin, linux
|
||||||
|
# $2 = amd64
|
||||||
|
function build()
|
||||||
|
{
|
||||||
|
echo build-$1-$2
|
||||||
|
if [ $1 = "linux" -o $1 = "darwin" ]
|
||||||
|
then
|
||||||
|
suffix=""
|
||||||
|
else
|
||||||
|
suffix=".exe"
|
||||||
|
fi
|
||||||
|
|
||||||
|
GOOS=$1 GOARCH=$2 go build -o leanote-$1-$2$suffix ../app/tmp
|
||||||
|
}
|
||||||
|
|
||||||
|
build "linux" "386";
|
||||||
|
build "linux" "amd64";
|
||||||
|
build "darwin" "386";
|
||||||
|
build "darwin" "amd64";
|
||||||
|
build "windows" "386";
|
||||||
|
build "windows" "amd64";
|
||||||
|
|
||||||
|
|
||||||
|
##======================
|
||||||
|
# 2. release目录准备工作
|
||||||
|
##======================
|
||||||
rm -rf $tmp/leanote
|
rm -rf $tmp/leanote
|
||||||
mkdir -p $tmp/leanote/app
|
mkdir -p $tmp/leanote/app
|
||||||
mkdir -p $tmp/leanote/conf
|
mkdir -p $tmp/leanote/conf
|
||||||
mkdir -p $tmp/leanote/bin
|
mkdir -p $tmp/leanote/bin
|
||||||
|
|
||||||
|
##==================
|
||||||
|
# 3. 复制
|
||||||
|
##==================
|
||||||
|
|
||||||
|
cd $SP
|
||||||
|
cd ../
|
||||||
|
|
||||||
# bin
|
# bin
|
||||||
cp -r ./bin/src $tmp/leanote/bin/
|
cp -r ./bin/src $tmp/leanote/bin/
|
||||||
cp ./bin/run.sh $tmp/leanote/bin/
|
cp ./bin/run.sh $tmp/leanote/bin/
|
||||||
|
cp ./bin/run.bat $tmp/leanote/bin/
|
||||||
# LICENSE
|
|
||||||
cp ./LICENSE $tmp/leanote/
|
|
||||||
|
|
||||||
# views
|
# views
|
||||||
cp -r ./app/views $tmp/leanote/app
|
cp -r ./app/views $tmp/leanote/app
|
||||||
# 可不要
|
# 可不要, 源码
|
||||||
cp -r ./app/service $tmp/leanote/app/service
|
#cp -r ./app/service $tmp/leanote/app/service
|
||||||
cp -r ./app/controllers $tmp/leanote/app/controllers
|
#cp -r ./app/controllers $tmp/leanote/app/controllers
|
||||||
cp -r ./app/db $tmp/leanote/app/db
|
#cp -r ./app/db $tmp/leanote/app/db
|
||||||
cp -r ./app/info $tmp/leanote/app/info
|
#cp -r ./app/info $tmp/leanote/app/info
|
||||||
cp -r ./app/lea $tmp/leanote/app/lea
|
#cp -r ./app/lea $tmp/leanote/app/lea
|
||||||
|
|
||||||
# conf
|
# conf
|
||||||
cp ./conf/app.conf-default $tmp/leanote/conf/app.conf
|
cp ./conf/app.conf $tmp/leanote/conf/app.conf
|
||||||
cp ./conf/routes-default $tmp/leanote/conf/routes
|
cp ./conf/routes $tmp/leanote/conf/routes
|
||||||
|
|
||||||
# others
|
# others
|
||||||
cp -r ./messages ./public ./mongodb_backup $tmp/leanote/
|
cp -r ./messages ./public ./mongodb_backup $tmp/leanote/
|
||||||
@ -44,40 +83,55 @@ cp -r ./messages ./public ./mongodb_backup $tmp/leanote/
|
|||||||
rm -r $tmp/leanote/public/tinymce/classes
|
rm -r $tmp/leanote/public/tinymce/classes
|
||||||
rm -r $tmp/leanote/public/upload
|
rm -r $tmp/leanote/public/upload
|
||||||
mkdir $tmp/leanote/public/upload
|
mkdir $tmp/leanote/public/upload
|
||||||
mkdir $tmp/leanote/files
|
|
||||||
rm -r $tmp/leanote/public/.codekit-cache
|
rm -r $tmp/leanote/public/.codekit-cache
|
||||||
rm $tmp/leanote/public/.DS_Store
|
rm $tmp/leanote/public/.DS_Store
|
||||||
rm $tmp/leanote/public/config.codekit
|
rm $tmp/leanote/public/config.codekit
|
||||||
|
|
||||||
# make link
|
# make link
|
||||||
cd $tmp/leanote/bin
|
# cd $tmp/leanote/bin
|
||||||
mkdir ./src/github.com/leanote
|
|
||||||
# ln -s ../../../../ ./src/github.com/leanote/leanote
|
# ln -s ../../../../ ./src/github.com/leanote/leanote
|
||||||
|
|
||||||
# archieve
|
# archieve
|
||||||
# << 'BLOCK
|
# << 'BLOCK
|
||||||
# linux
|
|
||||||
cd $SP
|
|
||||||
cd ../
|
|
||||||
cp ./bin/leanote-linux $tmp/leanote/bin/
|
|
||||||
cd $tmp
|
|
||||||
tar -cvf $tmp/leanote-linux-$version.bin.tar leanote
|
|
||||||
gzip $tmp/leanote-linux-$version.bin.tar
|
|
||||||
|
|
||||||
# mac
|
##===========
|
||||||
rm $tmp/leanote/bin/leanote-linux
|
# 4. 打包
|
||||||
cd $SP
|
##===========
|
||||||
cd ../
|
# $1 = linux
|
||||||
cp ./bin/leanote-mac $tmp/leanote/bin/
|
# $2 = 386, amd64
|
||||||
cd $tmp
|
|
||||||
tar -cvf $tmp/leanote-mac-$version.bin.tar leanote
|
|
||||||
gzip $tmp/leanote-mac-$version.bin.tar
|
|
||||||
|
|
||||||
cd $SP
|
# 创建一个$V的目录存放之
|
||||||
cd ../
|
rm -rf $tmp/$V
|
||||||
cp ./bin/leanote-linux $tmp/leanote/bin/
|
mkdir $tmp/$V
|
||||||
|
|
||||||
rm $tmp/bin/src/github.com/leanote/leanote
|
function tarRelease()
|
||||||
cp -r $tmp/leanote/* $tmp/leanote_release_github
|
{
|
||||||
|
echo tar-$1-$2
|
||||||
|
cd $SP
|
||||||
|
cd ../
|
||||||
|
rm $tmp/leanote/bin/leanote-* # 删除之前的bin文件
|
||||||
|
rm $tmp/leanote/bin/run* # 删除之前的run.sh 或 run.bat
|
||||||
|
|
||||||
|
if [ $1 = "linux" -o $1 = "darwin" ]
|
||||||
|
then
|
||||||
|
suffix=""
|
||||||
|
cp ./bin/run.sh $tmp/leanote/bin/
|
||||||
|
else
|
||||||
|
cp ./bin/run.bat $tmp/leanote/bin/
|
||||||
|
suffix=".exe"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp ./bin/leanote-$1-$2$suffix $tmp/leanote/bin/
|
||||||
|
cd $tmp
|
||||||
|
tar -cf $tmp/$V/leanote-$1-$2-$V.bin.tar leanote
|
||||||
|
gzip $tmp/$V/leanote-$1-$2-$V.bin.tar
|
||||||
|
}
|
||||||
|
|
||||||
|
tarRelease "linux" "386";
|
||||||
|
tarRelease "linux" "amd64";
|
||||||
|
tarRelease "darwin" "386";
|
||||||
|
tarRelease "darwin" "amd64";
|
||||||
|
tarRelease "windows" "386";
|
||||||
|
tarRelease "windows" "amd64";
|
||||||
|
|
||||||
# BLOCK'
|
# BLOCK'
|
23
bin/run.bat
Normal file
23
bin/run.bat
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
cd..
|
||||||
|
set SCRIPTPATH=%cd%
|
||||||
|
|
||||||
|
: top src directory
|
||||||
|
set path="%SCRIPTPATH%\bin\src\github.com\leanote"
|
||||||
|
|
||||||
|
if not exist "%path%" mkdir "%path%"
|
||||||
|
|
||||||
|
: create software link
|
||||||
|
if exist "%path%\leanote" del /Q "%path%\leanote"
|
||||||
|
mklink /D "%path%\leanote" %SCRIPTPATH%
|
||||||
|
|
||||||
|
: set GOPATH
|
||||||
|
set GOPATH=%GOPATH%;"%SCRIPTPATH%\bin"
|
||||||
|
|
||||||
|
: run
|
||||||
|
if %processor_architecture%==x86 (
|
||||||
|
"%SCRIPTPATH%\bin\leanote-windows-386.exe" -importPath github.com/leanote/leanote
|
||||||
|
) else (
|
||||||
|
"%SCRIPTPATH%\bin\leanote-windows-amd64.exe" -importPath github.com/leanote/leanote
|
||||||
|
)
|
15
bin/run.sh
15
bin/run.sh
@ -7,17 +7,16 @@ path="$SCRIPTPATH/src/github.com/leanote"
|
|||||||
if [ ! -d "$path" ]; then
|
if [ ! -d "$path" ]; then
|
||||||
mkdir -p "$path"
|
mkdir -p "$path"
|
||||||
fi
|
fi
|
||||||
|
rm -rf $SCRIPTPATH/src/github.com/leanote/leanote # 先删除
|
||||||
ln -s ../../../../ $SCRIPTPATH/src/github.com/leanote/leanote
|
ln -s ../../../../ $SCRIPTPATH/src/github.com/leanote/leanote
|
||||||
|
|
||||||
# set GOPATH
|
# set GOPATH
|
||||||
export GOPATH=$GOPATH:$SCRIPTPATH
|
export GOPATH=$GOPATH:$SCRIPTPATH
|
||||||
|
|
||||||
# run
|
# run
|
||||||
osName=`uname`
|
osName=`uname` # Darwin or Linux
|
||||||
if [ $osName == "Darwin" ]; then
|
osName=`tr '[A-Z]' '[a-z]' <<<"$osName"` # toLowerCase
|
||||||
chmod 777 "$SCRIPTPATH/leanote-mac"
|
bit=`getconf LONG_BIT` # 32, 64
|
||||||
"$SCRIPTPATH/leanote-mac" -importPath github.com/leanote/leanote
|
script="$SCRIPTPATH/leanote-$osName-$bit"
|
||||||
else
|
chmod 777 $script
|
||||||
chmod 777 "$SCRIPTPATH/leanote-linux"
|
$script -importPath github.com/leanote/leanote
|
||||||
"$SCRIPTPATH/leanote-linux" -importPath github.com/leanote/leanote
|
|
||||||
fi
|
|
Reference in New Issue
Block a user