-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
38 lines (32 loc) · 1.24 KB
/
.gitlab-ci.yml
File metadata and controls
38 lines (32 loc) · 1.24 KB
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
variables:
#打包格式,支持zip和tar两种输出格式
FORMAT: zip
#打包所用的分支或者标签:origin/master表示打包主分支,
Branch_or_Tag: origin/master
#生成zip的名称
ZIP_NAME: 启明RA6M5_FSP库_
#NAS地址 数量不匹配需要删改PDF-files任务中的内容
NAS_URL1: /mnt/百度云对外发布资料/瑞萨产品线/野火【RA系列开发板】资料/1-程序源码_教程文档/1-书籍配套例程/启明RA6M5
#NAS_URL2:
# NAS_URL3:
#阶段步骤
stages:
- pack
code-pack:
tags:
- ENABLE
stage: pack
when: manual
script:
- now="`date +%Y%m%d`"
# 打包
- git archive --format=$FORMAT --output $ZIP_NAME$now.$FORMAT $Branch_or_Tag
#网盘同步,在不同的仓库中都需要修改
#NAS_URL1
# 获取要延时删除的zip包列表
- find "$NAS_URL1" -path "$NAS_URL1/$ZIP_NAME$now.$FORMAT" -prune -o -type f -name "*.$FORMAT" -print > /root/autodelate/temp/$ZIP_NAME$now.log
# 复制新的压缩包
- cp -f $ZIP_NAME$now.$FORMAT "$NAS_URL1"
#NAS_URL2
#- find "$NAS_URL2" -path "$NAS_URL2/$ZIP_NAME$now.$FORMAT" -prune -o -type f -name "*.$FORMAT" -print >> /root/autodelate/temp/$ZIP_NAME$now.log
#- cp -f $ZIP_NAME$now.$FORMAT "$NAS_URL2"