Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard-package-script
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
mycard-package-script
Commits
983c2d64
Commit
983c2d64
authored
Aug 24, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finish
parent
adba4104
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
20 deletions
+60
-20
README.md
README.md
+25
-1
delete-build.sh
delete-build.sh
+5
-0
pack-all.sh
pack-all.sh
+1
-1
pack.sh
pack.sh
+2
-2
src/login.sh
src/login.sh
+5
-0
src/pack-utility.sh
src/pack-utility.sh
+12
-16
src/prefix.sh
src/prefix.sh
+10
-0
No files found.
README.md
View file @
983c2d64
# mycard-package-script
# mycard-package-script
萌卡 app 打包脚本,前端没搞好的时候凑合用
萌卡 app 打包脚本,前端没搞好的时候凑合用
\ No newline at end of file
## 需要安装
*
tar
*
zstd
*
jq
*
curl
## 如何使用
```
bash
./pack.sh <APP 名称> <APP 路径>
```
## 变量
*
`username`
`password`
萌卡帐号密码,需要有那个 app 的打包权限。
*
`appVersion`
APP 版本号,如果不存在则从 APP 信息获取最新版本号。
*
`platform`
`arch`
`locale`
APP Depot 信息,空缺字段则用
`generic`
补全。
delete-build.sh
0 → 100755
View file @
983c2d64
#!/bin/bash
# set -o errexit
source
./src/pack-utility.sh
deleteBuild
"
$@
"
pack-all.sh
View file @
983c2d64
...
@@ -4,6 +4,6 @@ source ./src/pack-utility.sh
...
@@ -4,6 +4,6 @@ source ./src/pack-utility.sh
cd
pool
cd
pool
for
appName
in
*
;
do
for
appName
in
*
;
do
runApp
"
$appName
"
"
$appName
"
makeBuild
"
$appName
"
"
$appName
"
done
done
cd
..
cd
..
pack.sh
View file @
983c2d64
#!/bin/bash
#!/bin/bash
# set -o errexit
# set -o errexit
source
./pack-utility.sh
source
./
src/
pack-utility.sh
appName
=
"
$1
"
appName
=
"
$1
"
appPath
=
"
$2
"
appPath
=
"
$2
"
if
[[
-z
"
$appPath
"
]]
;
then
if
[[
-z
"
$appPath
"
]]
;
then
appPath
=
"pool/
$appName
"
appPath
=
"pool/
$appName
"
fi
fi
runApp
$appName
"
$appPath
"
makeBuild
"
$appName
"
"
$appPath
"
src/login.sh
0 → 100755
View file @
983c2d64
apiRoot
=
https://api.moecube.com
loginInfo
=
$(
curl
-sL
-X
POST
$apiRoot
/accounts/signin
-d
account
=
$username
-d
password
=
$password
)
token
=
$(
echo
$loginInfo
| jq
'.token'
|
sed
's/"//g'
)
header
=
"Authorization:
$token
"
src/pack-utility.sh
View file @
983c2d64
apiRoot
=
https://api.moecube.com
apiRoot
=
https://api.moecube.com
loginInfo
=
$(
curl
-sL
-X
POST
$apiRoot
/accounts/signin
-d
account
=
$username
-d
password
=
$password
)
source
./src/login.sh
token
=
$(
echo
$loginInfo
| jq
'.token'
|
sed
's/"//g'
)
source
./src/prefix.sh
header
=
"Authorization:
$token
"
echo
"Logged in."
if
[[
-z
"
$platform
"
]]
;
then
makeBuild
()
{
platform
=
"generic"
fi
if
[[
-z
"
$arch
"
]]
;
then
arch
=
"generic"
fi
if
[[
-z
"
$locale
"
]]
;
then
locale
=
"generic"
fi
suffix
=
"?platform=
$platform
&arch=
$arch
&locle=
$locale
"
runApp
()
{
appName
=
"
$1
"
appName
=
"
$1
"
appPath
=
"
$2
"
appPath
=
"
$2
"
echo
"Packaging
$appName
"
echo
"Packaging
$appName
"
...
@@ -33,3 +20,12 @@ runApp() {
...
@@ -33,3 +20,12 @@ runApp() {
echo
"Finished."
echo
"Finished."
cd
"
$currentPath
"
cd
"
$currentPath
"
}
}
deleteBuild
()
{
appName
=
"
$1
"
if
[[
-z
"
$appVersion
"
]]
;
then
appVersion
=
"
$2
"
fi
echo
"Version:
$appVersion
"
curl
-sL
-H
"
$header
"
-X
DELETE
"
$apiRoot
/release/api/build/
$appName
/
${
appVersion
}${
suffix
}
"
}
src/prefix.sh
0 → 100755
View file @
983c2d64
if
[[
-z
"
$platform
"
]]
;
then
platform
=
"generic"
fi
if
[[
-z
"
$arch
"
]]
;
then
arch
=
"generic"
fi
if
[[
-z
"
$locale
"
]]
;
then
locale
=
"generic"
fi
suffix
=
"?platform=
$platform
&arch=
$arch
&locle=
$locale
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment