File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change 21
21
22
22
TARGET_BRANCH="deploy"
23
23
BASE_BRANCH="origin/build/master"
24
+ ORIGIN_URL=$(git remote get-url origin)
25
+ SUFFIX=".git"
26
+ TARGET_URL=${ORIGIN_URL%$SUFFIX}
24
27
25
28
if git ls-remote --heads origin ${TARGET_BRANCH} | grep ${TARGET_BRANCH}; then
26
29
git push origin --delete ${TARGET_BRANCH}
@@ -32,17 +35,13 @@ jobs:
32
35
branches=$(git branch -r | grep 'origin/build/ver/')
33
36
34
37
for branch in $branches; do
35
- branch_name=$(echo $branch | sed 's|origin/||')
36
- local_dir=$(echo $branch_name | sed 's|build/ver/||')
37
-
38
- git checkout -b $branch_name $branch
39
-
40
- mkdir -p ./$local_dir
41
-
42
- rsync -av --exclude='.git' ./ ./$local_dir
43
-
44
- git checkout ${BASE_BRANCH}
45
- git branch -D $branch_name
38
+ BRANCH_NAME=$(echo $branch | sed 's|origin/||')
39
+ LOCAL_DIR=$(echo $branch_name | sed 's|build/ver/||')
40
+ TARGET_ZIP="${TARGET_URL}/archive/refs/heads/${BRANCH_NAME}.zip"
41
+ mkdir -p ${LOCAL_DIR}
42
+ wget --max-redirect=10 -O ${LOCAL_DIR}/dist.zip $url
43
+ unzip ${LOCAL_DIR}/dist.zip -d ${LOCAL_DIR}
44
+ rm ${LOCAL_DIR}/dist.zip
46
45
done
47
46
48
47
git push origin "${TARGET_BRANCH}"
You can’t perform that action at this time.
0 commit comments