-
Notifications
You must be signed in to change notification settings - Fork 5
/
build-zyc-stock
68 lines (66 loc) · 2.02 KB
/
build-zyc-stock
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#! /bin/bash
if [ ! -z "$1" ];then
TAGS="$1"
else
TAGS=""
fi
function update_file() {
if [ ! -z "$1" ] && [ ! -z "$2" ] && [ ! -z "$3" ];then
GetValue="$(cat "$3" | grep "$1")"
GetPath=${3/"./"/"/"}
[ "$GetValue" != "$2" ] && \
sed -i "s/$1.*/$2/g" "$3"
[ ! -z "$(git status | grep "modified" )" ] && \
git add "$3" && \
git commit -m "update builder $2"
fi
}
function update_fileB() {
if [ ! -z "$1" ] && [ ! -z "$2" ] && [ ! -z "$3" ];then
GetValue="$(cat "$3" | grep "$1")"
GetPath=${3/"./"/"/"}
[ "$GetValue" != "$2" ] && \
sed -i "s/$1.*/$2"'"'"/g" "$3"
[ ! -z "$(git status | grep "modified" )" ] && \
git add "$3" && \
git commit -m "update builder $2"
fi
}
function make_changes() {
git checkout master && git checkout -b $1-$2
git checkout $1-$2 && update_fileB "00000" "$2" "./$1.sh" && update_file 'do-main.sh' "$1.sh" './.circleci/config.yml' && update_file 'main.sh' "$1.sh"'"' './.drone.yml'
}
# FolderUp="xobod-stock"
# KernelFiles='None'
# DoSplitDate='Y'
# CurrFolder=$(pwd)
# FolderDrive=../../compilled-gdrive
# cd $FolderDrive
# . run.sh "$KernelFiles" "$FolderUp" "$(date +"%m-%d-%Y")" "$ExFolder"
# cd $CurrFolder
git reset --hard
ListBranch=""
for Files in do-stock-p do-stock-q do-stock-r
do
if [ "$TAGS" == "all" ];then
if [[ -e ${Files}.sh ]];then
for Types in clang dtc gcc
do
git branch -D $Files-$Types
make_changes $Files $Types
ListBranch="$ListBranch $Files-$Types"
git checkout master
done
fi
else
if [[ -e ${Files}.sh ]];then
if [ "$TAGS" == "gcc" ] || [ "$TAGS" == "clang" ] || [ "$TAGS" == "dtc" ];then
git branch -D $Files-$TAGS
make_changes $Files $TAGS
ListBranch="$ListBranch $Files-$TAGS"
git checkout master
fi
fi
fi
done
git push -f zero $ListBranch