+ Windows support
This commit is contained in:
parent
df3a46faa3
commit
f940f176f3
4 changed files with 122 additions and 26 deletions
9
Makefile
9
Makefile
|
|
@ -173,6 +173,7 @@ release: clean
|
|||
# cd dist/release && GOOS=linux GOARCH=arm GOARM=7 go build -v -o ../../.tmp/xiang-${VERSION}-linux-arm
|
||||
# cd dist/release && GOOS=linux GOARCH=arm64 GOARM=7 go build -v -o ../../.tmp/xiang-${VERSION}-linux-arm64
|
||||
cd dist/release && GOOS=darwin GOARCH=amd64 go build -v -o ../../.tmp/xiang-${VERSION}-darwin-amd64
|
||||
cd dist/release && GOOS=windows GOARCH=386 go build -v -o ../../.tmp/xiang-${VERSION}-windows-386
|
||||
|
||||
rm -rf dist/release
|
||||
mkdir -p dist/release
|
||||
|
|
@ -215,6 +216,14 @@ arm: clean
|
|||
mv .tmp/xiang-*-* dist/release/
|
||||
chmod +x dist/release/xiang-*-*
|
||||
|
||||
.PHONY: win32
|
||||
win32: bindata
|
||||
GOOS=windows GOARCH=386 go build -v -o .tmp/xiang-windows-386
|
||||
mkdir -p dist/bin
|
||||
mv .tmp/xiang-*-* dist/bin/
|
||||
chmod +x dist/bin/xiang-*-*
|
||||
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf ./tmp
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ func uiIndexHtml() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "ui/index.html", size: 12, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "ui/index.html", size: 12, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ func xiangDs_store() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/.DS_Store", size: 6148, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/.DS_Store", size: 6148, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -244,7 +244,7 @@ func xiangApisReadmeMd() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/apis/README.md", size: 13, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/apis/README.md", size: 13, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -264,7 +264,7 @@ func xiangApisChartHttpJson() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/apis/chart.http.json", size: 624, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/apis/chart.http.json", size: 624, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -284,7 +284,7 @@ func xiangApisPageHttpJson() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/apis/page.http.json", size: 609, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/apis/page.http.json", size: 609, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -304,7 +304,7 @@ func xiangApisStorageHttpJson() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/apis/storage.http.json", size: 1092, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/apis/storage.http.json", size: 1092, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -324,7 +324,7 @@ func xiangApisTableHttpJson() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/apis/table.http.json", size: 2632, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/apis/table.http.json", size: 2632, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -344,7 +344,7 @@ func xiangApisUserHttpJson() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/apis/user.http.json", size: 1453, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/apis/user.http.json", size: 1453, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -364,7 +364,7 @@ func xiangApisXiangHttpJson() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/apis/xiang.http.json", size: 1239, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/apis/xiang.http.json", size: 1239, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -384,7 +384,7 @@ func xiangDataAppJson() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/data/app.json", size: 245, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/data/app.json", size: 245, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -404,7 +404,7 @@ func xiangDataIconsDs_store() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/data/icons/.DS_Store", size: 6148, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/data/icons/.DS_Store", size: 6148, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -424,7 +424,7 @@ func xiangDataIcons404Png() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/data/icons/404.png", size: 9342, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/data/icons/404.png", size: 9342, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -444,7 +444,7 @@ func xiangDataIconsIconIcns() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/data/icons/icon.icns", size: 75636, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/data/icons/icon.icns", size: 75636, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -464,7 +464,7 @@ func xiangDataIconsIconIco() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/data/icons/icon.ico", size: 31310, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/data/icons/icon.ico", size: 31310, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -484,7 +484,7 @@ func xiangDataIconsIconPng() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/data/icons/icon.png", size: 22420, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/data/icons/icon.png", size: 22420, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -504,7 +504,7 @@ func xiangDataIndexHtml() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/data/index.html", size: 302, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/data/index.html", size: 302, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -524,7 +524,7 @@ func xiangFlowsReadmeMd() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/flows/README.md", size: 12, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/flows/README.md", size: 12, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -544,7 +544,7 @@ func xiangFlowsMenuFlowJson() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/flows/menu.flow.json", size: 1045, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/flows/menu.flow.json", size: 1045, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -564,7 +564,7 @@ func xiangFlowsTableGetFlowJson() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/flows/table/get.flow.json", size: 541, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/flows/table/get.flow.json", size: 541, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -584,7 +584,7 @@ func xiangModelsReadmeMd() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/models/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/models/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -604,7 +604,7 @@ func xiangModelsMenuJson() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/models/menu.json", size: 2378, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/models/menu.json", size: 2378, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -624,7 +624,7 @@ func xiangModelsUserJson() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/models/user.json", size: 8826, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/models/user.json", size: 8826, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -644,7 +644,7 @@ func xiangModelsWorkflowModJson() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/models/workflow.mod.json", size: 3333, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/models/workflow.mod.json", size: 3333, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -664,7 +664,7 @@ func xiangTablesReadmeMd() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/tables/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/tables/README.md", size: 15, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -684,7 +684,7 @@ func xiangTablesMenuJson() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/tables/menu.json", size: 10382, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/tables/menu.json", size: 10382, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
@ -704,7 +704,7 @@ func xiangTablesUserJson() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "xiang/tables/user.json", size: 1422, mode: os.FileMode(420), modTime: time.Unix(1638115948, 0)}
|
||||
info := bindataFileInfo{name: "xiang/tables/user.json", size: 1422, mode: os.FileMode(420), modTime: time.Unix(1639932624, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
|
|||
18
release.sh
Executable file
18
release.sh
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
repace() {
|
||||
echo $1
|
||||
sed -E "$1" ~/Code/yao/xiang/shell/install.sh > ~/Code/yao/xiang/shell/install.sh.new
|
||||
}
|
||||
|
||||
VERSION=$(go run . version)
|
||||
ssh max@demo-crm.iqka.com mkdir -p /data/demo-crm/ui/releases/$VERSION/
|
||||
ssh max@demo-crm.iqka.com "echo {\\\"version\\\":\\\"$VERSION\\\"} > /data/demo-crm/ui/releases/latest.json"
|
||||
scp ../xiang-spec/xiang/xiang-$VERSION-linux-amd64 max@demo-crm.iqka.com:/data/demo-crm/ui/releases/$VERSION/yao-$VERSION-linux-amd64
|
||||
scp ../xiang-spec/xiang/xiang-$VERSION-darwin-amd64 max@demo-crm.iqka.com:/data/demo-crm/ui/releases/$VERSION/yao-$VERSION-darwin-amd64
|
||||
scp ../xiang-spec/xiang/xiang-$VERSION-windows-386 max@demo-crm.iqka.com:/data/demo-crm/ui/releases/$VERSION/yao-$VERSION-windows-386
|
||||
|
||||
repace "s/\[[0-9]+\.[0-9]+\.[0-9]+\]/[$VERSION]/g"
|
||||
scp ~/Code/yao/xiang/shell/install.sh.new max@demo-crm.iqka.com:/data/demo-crm/ui/releases/$VERSION/install.sh
|
||||
rm ~/Code/yao/xiang/shell/install.sh.new
|
||||
|
||||
69
shell/install.sh
Executable file
69
shell/install.sh
Executable file
|
|
@ -0,0 +1,69 @@
|
|||
#!/bin/bash
|
||||
VERSION="0.9.11"
|
||||
URL="https://demo-crm.iqka.com/releases/$VERSION"
|
||||
|
||||
function macos(){
|
||||
tmpdir=$(dirname $(mktemp -u))
|
||||
curl "$URL/yao-$VERSION-darwin-amd64" --output "$tmpdir/yao-$VERSION"
|
||||
ls -l $tmpdir/yao-$VERSION
|
||||
rmOldVersion
|
||||
sudo mv $tmpdir/yao-$VERSION /usr/local/bin/yao
|
||||
sudo chmod +x /usr/local/bin/yao
|
||||
echo ""
|
||||
echo /usr/local/bin/yao
|
||||
/usr/local/bin/yao version
|
||||
echo "DONE"
|
||||
}
|
||||
|
||||
function linux(){
|
||||
tmpdir=$(dirname $(mktemp -u))
|
||||
curl "$URL/yao-$VERSION-linux-amd64" --output "$tmpdir/yao-$VERSION"
|
||||
ls -l $tmpdir/yao-$VERSION
|
||||
rmOldVersion
|
||||
sudo mv $tmpdir/yao-$VERSION /usr/local/bin/yao
|
||||
sudo chmod +x /usr/local/bin/yao
|
||||
echo ""
|
||||
echo /usr/local/bin/yao
|
||||
/usr/local/bin/yao version
|
||||
echo "DONE"
|
||||
}
|
||||
|
||||
|
||||
function rmOldVersion() {
|
||||
if command -v /usr/local/bin/yao &> /dev/null
|
||||
then
|
||||
sudo mv /usr/local/bin/yao /usr/local/bin/yao.bak
|
||||
fi
|
||||
}
|
||||
|
||||
function rmOldVersionWin() {
|
||||
if command -v /usr/local/bin/yao &> /dev/null
|
||||
then
|
||||
mv /usr/local/bin/yao /usr/local/bin/yao.bak
|
||||
fi
|
||||
}
|
||||
|
||||
function windows(){
|
||||
tmpdir=$(dirname $(mktemp -u))
|
||||
curl "$URL/yao-$VERSION-windows-386" --output "$tmpdir/yao-$VERSION"
|
||||
ls -l $tmpdir/yao-$VERSION
|
||||
rmOldVersionWin
|
||||
mv $tmpdir/yao-$VERSION /usr/local/bin/yao
|
||||
chmod +x /usr/local/bin/yao
|
||||
echo ""
|
||||
echo /usr/local/bin/yao
|
||||
/usr/local/bin/yao version
|
||||
echo "DONE"
|
||||
}
|
||||
|
||||
|
||||
if [ "$(uname)" = "Darwin" ];then
|
||||
macos
|
||||
elif [ "$(expr substr $(uname -s) 1 5)" = "Linux" ];then
|
||||
linux
|
||||
elif [ "$(expr substr $(uname -s) 1 9)" = "CYGWIN_NT" ];then
|
||||
windows
|
||||
else
|
||||
echo $(uname -s) "does not support"
|
||||
fi
|
||||
|
||||
Loading…
Add table
Reference in a new issue