Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
985fad9e
提交
985fad9e
authored
5月 07, 2012
作者:
Travis Cross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
prepare the tag script for the new release
上级
20ac9757
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
85 行增加
和
50 行删除
+85
-50
common.sh
scripts/ci/common.sh
+10
-0
tagscript.sh
scripts/tagscript.sh
+75
-50
没有找到文件。
scripts/ci/common.sh
浏览文件 @
985fad9e
...
...
@@ -37,6 +37,11 @@ parse_version () {
micro
=
"0"
ver
=
"
${
major
}
.
${
minor
}${
rev
}
"
fi
gver
=
"
$(
echo
"
$ver
"
|
sed
-e
's/[~_]/-/'
)
"
grev
=
"
$(
echo
"
$rev
"
|
sed
-e
's/[~_]/-/'
)
"
gmajor
=
"
$major
"
gminor
=
"
$minor
"
gmicro
=
"
$micro
"
[
-n
"
$crev
"
]
&&
cver
=
"
${
cver
}
.
${
crev
}
"
echo
"ver='
$ver
'"
echo
"major='
$major
'"
...
...
@@ -48,6 +53,11 @@ parse_version () {
echo
"cminor='
$cminor
'"
echo
"cmicro='
$cmicro
'"
echo
"crev='
$crev
'"
echo
"gver='
$gver
'"
echo
"gmajor='
$gmajor
'"
echo
"gminor='
$gminor
'"
echo
"gmicro='
$gmicro
'"
echo
"grev='
$grev
'"
}
set_fs_ver
()
{
...
...
scripts/tagscript.sh
浏览文件 @
985fad9e
...
...
@@ -2,20 +2,38 @@
##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
##### release a version of FreeSWITCH
src_repo
=
"
$(
pwd
)
"
sdir
=
"."
[
-n
"
${
0
%/*
}
"
]
&&
sdir
=
"
${
0
%/*
}
"
.
$sdir
/ci/common.sh
if
[
!
-d
.git
]
;
then
echo
"error: must be run from within the top level of a FreeSWITCH git tree."
1>&2
exit
1
;
fi
check_pwd
showusage
()
{
echo
"usage: ./scripts/tagscript.sh [-s] MAJOR.MINOR.MICRO[.REVISION]"
1>&2
cat
>
&2
<<
EOF
usage:
$0
[-s] <version>
where <version> follows the format:
1.2-alpha3
1.2-beta3
1.2-rc3
1.2
1.2.13-rc4
1.2.13
etc.
I'll take care of correctly naming the tag to be consistent with
FreeSWITCH git policy from there.
EOF
exit
1
;
}
while
getopts
"s"
o
;
do
opts
=
""
debug
=
false
while
getopts
"ds"
o
;
do
case
"
$o
"
in
d
)
debug
=
true
;;
s
)
opts
=
"-s"
;;
esac
done
...
...
@@ -25,67 +43,74 @@ if [ -z "$1" ]; then
showusage
fi
ver
=
"
$1
"
major
=
$(
echo
"
$ver
"
|
cut
-d
.
-f1
)
minor
=
$(
echo
"
$ver
"
|
cut
-d
.
-f2
)
micro
=
$(
echo
"
$ver
"
|
cut
-d
.
-f3
)
rev
=
$(
echo
"
$ver
"
|
cut
-d
.
-f4
)
eval
$(
parse_version
"
$1
"
)
dst_name
=
"freeswitch-
$major
.
$minor
.
$micro
"
dst_dir
=
"
$src_repo
/../
$dst_name
"
ngrep
()
{
grep
-e
"
$1
"
>
/dev/null
;
}
if
[
-d
"
$dst_dir
"
]
;
then
echo
"error: destination directory
$dst_dir
already exists."
1>&2
exit
1
;
if
!
$debug
&&
!
(
echo
"
$opts
"
| ngrep
'-s'
)
;
then
cat
>
&2
<<
EOF
You've asked me to tag a release but haven't asked to me sign it by
passing -s. I'll do this if you really want, but it's a bad idea if
you're making an actual release of FreeSWITCH that'll be seen
publicly.
EOF
while
true
;
do
echo
-n
"Is this just a test tag? (yes/no): "
>
&2
read
r
[
-z
"
$r
"
]
&&
continue
if
[
"
$r
"
=
yes
]
||
[
"
$r
"
=
y
]
;
then
(
echo
;
echo
"OK, I believe you."
;
echo
)
>
&2
break
else
(
echo
;
echo
"This is a bad idea then."
;
echo
)
>
&2
fi
while
true
;
do
echo
-n
"Are you really really sure? (yes/no): "
>
&2
read
r
[
-z
"
$r
"
]
&&
continue
if
[
"
$r
"
=
yes
]
||
[
"
$r
"
=
y
]
;
then
(
echo
;
echo
"As you wish, you've been warned."
;
echo
)
>
&2
break
else
(
echo
;
echo
"Great; go setup a GPG key and try again with -s"
;
echo
)
>
&2
exit
1
fi
break
done
break
done
fi
# save local changes
echo
"Saving uncommitted changes before tagging..."
>
&2
ret
=
$(
git stash save
"Save uncommitted changes before tagging."
)
if
echo
$ret
|
grep
"^Saved"
;
then
if
(
echo
"
$ret
"
| ngrep
'^Saved'
)
;
then
stash_saved
=
1
fi
sed
-e
"s|
\(
AC_SUBST(SWITCH_VERSION_MAJOR,
\[\)
.*
\(\]
)
\)
|
\1
$major
\2
|"
\
-e
"s|
\(
AC_SUBST(SWITCH_VERSION_MINOR,
\[\)
.*
\(\]
)
\)
|
\1
$minor
\2
|"
\
-e
"s|
\(
AC_SUBST(SWITCH_VERSION_MICRO,
\[\)
.*
\(\]
)
\)
|
\1
$micro
\2
|"
\
-e
"s|
\(
AC_INIT(
\[
freeswitch
\]
,
\[\)
.*
\(\]
, BUG-REPORT-ADDRESS)
\)
|
\1
$major
.
$minor
.
$micro
\2
|"
\
-i
configure.in
if
[
-n
"
$rev
"
]
;
then
sed
-e
"s|
\(
AC_SUBST(SWITCH_VERSION_REVISION,
\[\)
.*
\(\]
)
\)
|
\1
$rev
\2
|"
\
-e
"s|#
\(
AC_SUBST(SWITCH_VERSION_REVISION
\)
|
\1
|"
\
-i
configure.in
fi
echo
"Changing the version of configure.in..."
>
&2
set_fs_ver
"
$gver
"
"
$gmajor
"
"
$gminor
"
"
$gmicro
"
"
$grev
"
echo
"Committing the new version..."
>
&2
git add configure.in
git commit
-m
"Release freeswitch-
$ver
"
git tag
-a
${
opts
}
-m
"freeswitch-
$ver
release"
v
$ver
git commit
-m
"Release freeswitch-
$gver
"
echo
"Tagging freeswitch v
$gver
..."
>
&2
git tag
-a
${
opts
}
-m
"freeswitch-
$gver
release"
"v
$gver
"
git clone
$src_repo
$dst_dir
if
[
-n
"
$stash_saved
"
]
;
then
git stash pop
echo
"Restoring your uncommitted changes to your working directory..."
>
&2
git stash pop
>
/dev/null
fi
cd
$dst_dir
./bootstrap.sh
mv
bootstrap.sh rebootstrap.sh
rm
-f
docs/AUTHORS
rm
-f
docs/COPYING
rm
-f
docs/ChangeLog
rm
-rf
.git
cd
..
tar
-cvf
$dst_name
.tar
$dst_dir
gzip
-9
-c
$dst_name
.tar
>
$dst_name
.tar.gz
||
echo
"gzip not available"
bzip2
-z
-k
$dst_name
.tar
||
echo
"bzip2 not available"
xz
-z
-9
-k
$dst_name
.tar
||
echo
"xz / xz-utils not available"
rm
-rf
$dst_name
.tar
$dst_dir
cat
1>&2
<<
EOF
----------------------------------------------------------------------
The v
$ver
tag has been committed locally, but it will not be
The v
$
g
ver
tag has been committed locally, but it will not be
globally visible until you 'git push --tags' this repository up to the
server (I didn't do that for you, as you might want to review first).
Next step:
git push --tags
----------------------------------------------------------------------
EOF
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论