mirror of
https://github.com/monlor/MIXBOX-ARCHIVE.git
synced 2026-03-10 23:41:27 +00:00
2020-03-06 11:22:32
This commit is contained in:
@@ -1,10 +1,70 @@
|
||||
image: lholota/bash-git
|
||||
|
||||
stages:
|
||||
- pack
|
||||
- deploy
|
||||
|
||||
deploy:
|
||||
stage: deploy
|
||||
pack:
|
||||
stage: pack
|
||||
only:
|
||||
- master
|
||||
- test
|
||||
- dev
|
||||
script:
|
||||
- bash -e ./tools/gitsync.sh pack
|
||||
|
||||
deploy-gitlab:
|
||||
stage: deploy
|
||||
only:
|
||||
- master
|
||||
- test
|
||||
- dev
|
||||
script:
|
||||
- bash -e ./tools/gitsync.sh deploy mbfiles ${CI_COMMIT_REF_NAME} ${GL_REF}/monlor/mbfiles.git
|
||||
|
||||
deploy-coding:
|
||||
stage: deploy
|
||||
only:
|
||||
- master
|
||||
- test
|
||||
script:
|
||||
- bash -e ./tools/gitsync.sh deploy mbfiles ${CI_COMMIT_REF_NAME} ${CO_REF}/monlor/mbfiles.git
|
||||
|
||||
pack-all:
|
||||
stage: pack
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- deploy-*
|
||||
script:
|
||||
- git fetch origin master
|
||||
- git checkout master
|
||||
- bash -e ./tools/gitsync.sh pack mbfiles-master
|
||||
- git fetch origin test
|
||||
- git checkout test
|
||||
- bash -e ./tools/gitsync.sh pack mbfiles-test
|
||||
|
||||
deploy-all:
|
||||
stage: deploy
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- deploy-*
|
||||
script:
|
||||
- bash -e ./tools/gitsync.sh deploy mbfiles-master ${CI_COMMIT_REF_NAME} ${CO_REF}/monlor/mbfiles.git
|
||||
- bash -e ./tools/gitsync.sh deploy mbfiles-test ${CI_COMMIT_REF_NAME} ${CO_REF}/monlor/mbfiles.git
|
||||
|
||||
cache:
|
||||
key: ${CI_COMMIT_REF_NAME}
|
||||
untracked: true
|
||||
paths:
|
||||
- mbfiles/
|
||||
|
||||
cache:
|
||||
key: deploy-all
|
||||
untracked: true
|
||||
paths:
|
||||
- mbfiles-master/
|
||||
- mbfiles-test/
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ base_encode() {
|
||||
if [ -z "${1}" ]; then
|
||||
echo -n ""
|
||||
else
|
||||
if command -v base64-encode &> /dev/null; then
|
||||
if base64-encode &> /dev/null; then
|
||||
echo -n "$*" | base64-encode
|
||||
else
|
||||
echo -n "$*" | baseutil --b64
|
||||
@@ -52,7 +52,7 @@ base_decode() {
|
||||
if [ -z "${1}" ]; then
|
||||
echo -n ""
|
||||
else
|
||||
if command -v base64-decode &> /dev/null; then
|
||||
if base64-decode &> /dev/null; then
|
||||
echo -n "$*" | base64-decode
|
||||
else
|
||||
echo -n "$*" | baseutil --b64 -d
|
||||
|
||||
@@ -59,22 +59,29 @@ gerneral_applist() {
|
||||
|
||||
pack() {
|
||||
|
||||
local pack_dir="${1:-mbfiles}"
|
||||
|
||||
rm -rf appstore/
|
||||
rm -rf mbfiles/
|
||||
|
||||
echo "开始打包插件..."
|
||||
mkdir appstore
|
||||
ls apps/ | while read line; do
|
||||
# 取用缓存数据
|
||||
if [ -f ${pack_dir}/applist.txt ]; then
|
||||
version_old=`cat ${pack_dir}/applist.txt | grep "$line|" | cut -d'|' -f4`
|
||||
version_new=`cat apps/$line/config/$line.uci | grep "version=" | cut -d'=' -f2 | sed -e 's/"//g'`
|
||||
[ "$version_new" = "$version_old" ] && echo "$line未更新,跳过打包..." && continue
|
||||
fi
|
||||
pack_app $line
|
||||
done
|
||||
gerneral_applist
|
||||
|
||||
mkdir mbfiles
|
||||
cp -rf appsbin/ mbfiles/appsbin/
|
||||
cp -rf temp/ mbfiles/temp/
|
||||
cp -rf install.sh mbfiles/
|
||||
mv -f appstore/ mbfiles/appstore/
|
||||
mv -f applist.txt mbfiles/
|
||||
mkdir -p ${pack_dir}/appstore 2> /dev/null
|
||||
cp -rf appsbin/ ${pack_dir}/appsbin/
|
||||
cp -rf temp/ ${pack_dir}/temp/
|
||||
cp -rf install.sh ${pack_dir}/
|
||||
mv -f appstore/* ${pack_dir}/appstore/
|
||||
mv -f applist.txt ${pack_dir}/
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user