Obs-service-tar-scm具体参数参考

跳转至: 导航, 搜索
obs-service-tar-scm源代码处理服务的一个子服务。本服务使用SCM客户端从给定的存储库中签出或者更新代码。支持SVN, Git, hg与bzr. 获得到的代码将以OBS源服务器的增量存储格式(当前为cpio)进行存档。该归档文件将在构建目录中再次解压

参数

scm(必需)

描述:

 Specify SCM to use.  
 指定所使用的软件管理方式,若仅下载压缩包则不需要  

格式:

<param name="scm">VALUE</param>

允许的值:

<param name="scm">svn</param>  
<param name="scm">git</param>
<param name="scm">hz</param>
<param name="scm">bzr</param>

url(必需)

描述:

 Specify URL to checkout.  
 指定需要checkout的仓库地址

格式:

<param name="url">VALUE</param>

允许的值:

<param name="url">http://</param>
<param name="url">https://</param>
<param name="url">ftp://</param>
<param name="url">ftps:///param>
<param name="url">git://</param>
<param name="url">ssh://</param>

user

描述:

 Specify the username to be used for authentication to the repository.  
 指定用于仓库鉴权的用户

格式:

<param name="user">VALUE</param>

允许的值:

<param name="user">VALUE</param>

keyring-passphrase

描述:

 Specify the passphrase to decrypt credentials from the python keyring.  
 指定从python keyring解密证书的密码

格式:

<param name="keyring-passphrase">VALUE</param>

使用方法:

 若要存储您的证书,请使用如下命令
 sudo chown obsservicerun:obsrun /etc/obs/services/tar_scm.d
 sudo -H -u obsservicerun XDG_DATA_HOME=/etc/obs/services/tar_scm.d keyring -b keyrings.alt.file.EncryptedKeyring set URL USERNAME

注:

仅支持如下几种SCM与协议的组合  
     - git: ftp(s),http(s)  
     - svn  
     - bzr: bzr,ftp,http(s)  
     - hg: http(s)   

subdir

描述:

 Package just a subdirectory  
 仅打包一个子目录

格式:

<param name="subdir">VALUE</param>

允许的值:

<param name="subdir">VALUE</param>

version

描述:

 Specify version to be used in tarball.  Defaults to automatically detected value formatted by versionformat parameter (\_auto\_). 
 Use \_none\_ to disable version rewriting and use what is defined in the spec or debian/changelog.  
 指定用于tar包的版本号,默认为自动检测且根据versionfomart参数格式化的值(\_auto\_)  
 使用 \_none\_ 来禁用版本覆写,并且使用spec中或者 debian/changelog文件中定义的版本  

格式:

<param name="version">VALUE</param>

允许的值:

<param name="version">VALUE</param>
<param name="version">\_auto\_</param>
<param name="version">\_none\_</param>

versionformat

描述:

 Auto-generate version from checked out source using this format string.  This parameter is used if the 'version' parameter is not specified.  
 当 ‘version’ 参数未定义时,根据格式字符从checkout的源中自动生成版本号  
 For git, the value is passed to git log --date=short --pretty=format:...  
 对于Git, 此处的值会传递至 git log --date=short --pretty=format  
 for the topmost commit, and the output from git is cleaned up to remove some unhelpful characters.  Here are some useful examples of strings which are expanded, see the git-log documentation for more.  
 对于最新的commit,git将被清除一些无用的输出,这里提供了一些可能有用的可扩展的例子,更多详情请参考git-log文档  

格式:

<param name="versionformat">VALUE</param>  

允许的值:

<param name="versionformat">%ct</param>  
 UNIX时间戳格式的提交时间  
<param name="versionformat">%at</param>
 UNIX时间戳格式的著作时间  
<param name="versionformat">%cd</param>
 以 '年月日' 为格式的提交日期  
<param name="versionformat">%ad</param>
 以 '年月日' 为格式的著作日期  
<param name="versionformat">%h</param>
 短hash格式  
<param name="versionformat">@PARENT_TAG@</param>
 获取到的第一个tag  
<param name="versionformat">@TAG_OFFSET@</param>
 @PARENT_TAG@指定的tag的提交次数  

注:

 For hg, the value is passed to hg log --template=....  See the hg documentation for more information.  The default is '{rev}'  
 对hg而言,参数的值会传递到 hg log --template=.... 请参考hg的文档以获取更多信息,默认值为 '{rev}'   
 For bzr and svn, '%r' is expanded to the revision, and is the default.  
 对于bzr和svn, ‘%r’ 扩大到了修订版,并且是默认值 

versionrewrite-pattern

描述:

 Regex used to rewrite the version which is applied post versionformat. For example, to remove a tag prefix of "v" the regex "v(.*)" could be used.  
 当versionformat被应用后,正则表达式用来重写应用后的版本,例如,去除tag前缀中的 “v” 可以使用正则式 “v(.*)”   

格式:

<param name="versionrewrite-pattern">VALUE</param>  

允许的值:

<param name="versionrewrite-pattern">REGEX</param>  

versionrewrite-replacement

描述:

 Replacement applied to rewrite pattern. Typically backreferences are useful and as such defaults to \1.  
 将重写的部分进行替换,通常反向引用较为有用,默认为\1  

格式:

<param name="versionrewrite-replacement">VALUE</param>

允许的值:

<param name="versionrewrite-replacement">REGEX</param>

versionprefix

描述:

 Specify a base version as prefix.  
 定义一个起始版本作为前缀  

格式:

<param name="versionprefix">VALUE</param>

允许的值:

<param name="versionprefix">VALUE</param>

match-tag

描述:

 With this parameter you can specifiy a glob pattern (e.g. v*) to filter relevant tags in your project e.g. if you use @PARENT_TAG@.  
 使用此参数定义一个通配模式(例如v*)来过滤你项目中相关的项目(比如您使用了 @PARENT_TAG@)  

格式:

<param name="match-tag">VALUE</param>

允许的值:

<param name="match-tag">VALUE</param>

parent-tag

描述:

 This parameter allows overriding the tag that is being used for computing @TAG_OFFSET@  
 此参数允许覆盖用于计算 @TAG_OFFSET@ 的标签  

格式:

<param name="parent-tag">VALUE</param>

允许的值:

<param name="parent-tag">VALUE</param>

revision

描述:

 Specify revision of source to check out.  
 定义checkout的源的版本  
 When using git, revision may refer to any of the following:  
 当使用git的时候,revision可以引用如下的几种:  
 explicit SHA1(显式SHA1): a1b2c3d4....  
   - the SHA1 must be reachable from a default clone/fetch (generally, must be reachable from some branch or tag on the remote).  
   SHA1必须可以通过默认的clone/fetch访问。(通常来说,必须可从一些远程的分支或者tag上访问)  
   - set by: git checkout ${SHA1}  
  short branch name(短分支名): "master", "devel" etc.  
   - set by: git checkout ${branch}, git pull  
  explicit ref(显式引用): refs/heads/master, refs/tags/v1.2.3, refs/changes/49/11249/1  
   - set by: git fetch ${url} ${revision}:${revision}, git checkout ${revision}  

格式:

<param name="revision">VALUE</param>

允许的值:

<param name="revision">VALUE</param>

filename

描述:

 Specify name of package, which is used together with version to determine tarball name.  
 指定包名,并且与 ‘version’ 一起用于确定tar包名称  

格式:

<param name="filename">VALUE</param>

允许的值:

<param name="filename">VALUE</param>

extension

描述:

 Specify suffix name of package, which is used together with filename to determine tarball name.  
 指定包的后缀名,用于与 ‘filename’ 一起确定tar包名称  

格式:

<param name="extension">VALUE</param>

允许的值:

<param name="extension">VALUE</param>

exclude

描述:

 Specify glob pattern to exclude when creating the tarball.
 指定一个通配,用于在打tar包时排除文件

格式:

<param name="exclude">VALUE</param>

允许的值:

<param name="exclude">VALUE</param>

include

描述:

 Specify subset of files/subdirectories to pack in the tarball.
 指定要打包在tar包中的文件/子目录的集合  

格式:

<param name="include">VALUE</param>

允许的值:

<param name="include">VALUE</param>

extract

描述:

 Specify a file/glob to be exported directly. Useful for build descriptions like spec files which get maintained in the SCM. Can be used multiple times.
 指定要直接导出的文件/通配。对于构建说明(例如在SCM中维护的spec文件)很有用。可以多次使用  

格式:

<param name="extract">VALUE</param>

允许的值:

<param name="extract">VALUE</param>

package-meta

描述:

 Package the metadata of SCM to allow the user or OBS to update after un-tar.
 打包SCM元数据以允许用户或OBS在解压后更新

格式:

<param name="package-meta">VALUE</param>

允许的值:

<param name="package-meta">yes</param>

history-depth

描述:

 Obsolete parameter which will be ignored.
 过时的参数将被忽略

格式:

<param name="history-depth">VALUE</param>

允许的值:

<param name="history-depth">VALUE</param>

submodules

描述:

 Specify whether to include git submodules.  Default is 'enable'.
 指定是否包括Git子模块,默认为启用

格式:

<param name="submodules">VALUE</param>

允许的值:

<param name="submodules">enable</param>
<param name="submodules">master</param>
<param name="submodules">disable</param>

lfs (OBS_ONLY)

描述:

 Specify whether to include git-lfs blobs.  Default is 'disable'.
 指定是否包括git-lfs二进制扩展,默认为禁用

格式: <param name="lfs">VALUE</param>

允许的值:

<param name="lfs">enable</param>
<param name="lfs">disable</param>

sslverify

描述:

 Specify Whether or not to check server certificate against installed CAs.  Default is 'enable'.  
 指定是否根据已安装的CA检查服务器证书,默认为启用  

格式:

<param name="sslverify">VALUE</param>

允许的值:

<param name="sslverify">enable</param>
<param name="sslverify">disable</param>

changesgenerate

描述:

 Specify whether to generate changes file entries from SCM commit log since a given parent revision (see changesrevision).  Default is 'disable'.  
 指定自给定的基础修订版以来,是否从SCM提交日志生成更改文件条目(请参阅changesrevision),默认为禁用

格式:

<param name="changesgenerate">VALUE</param>

允许的值:

<param name="changesgenerate">enable</param>
<param name="changesgenerate">disable</param>

changesauthor

描述:

 Specify author of the changes file entry to be written.  Defaults to first email entry in ~/.oscrc, or "obs-service-tar-scm@invalid" if there is no .oscrc found.
 指定要写入更新日志的作者。默认为 ~/.oscrc的第一条电子邮件,如果没有.oscrc文件则默认为 'obs-service-tar-scm@invalid' 

格式:

<param name="changesauthor">VALUE</param>

允许的值:

<param name="changesauthor">VALUE</param>

locale

描述:

 DEPRECATED - Please use "encoding" instead. Set locale while execution of service
 已废弃,请使用 "encoding"参数替代,设定服务执行时的地区  

格式:

<param name="locale">VALUE</param>

允许的值:

<param name="locale">VALUE</param>

encoding

描述:

 Set encoding while execution of service
 设定执行服务时的编码

格式:

<param name="encoding">VALUE</param>

允许的值:

<param name="encoding">VALUE</param>

latest-signed-commit

描述:

 Use the latest signed commit on a branch
 使用分支上最新的已签名的commit

格式:

<param name="latest-signed-commit">VALUE</param>

允许的值:

<param name="latest-signed-commit">VALUE</param>

latest-signed-tag

描述:

 Use the latest signed tag on a branch、
 使用分支上最新的已签名的tag

格式:

<param name="latest-signed-tag">VALUE</param>

允许的值:

<param name="latest-signed-tag">VALUE</param>

maintainers-asc

描述:

 File which contains maintainers pubkeys (only used with '--latest-signed-*')
 含有维护者公钥的文件(仅搭配'--latest-signed-*'使用)

格式:

<param name="maintainers-asc">VALUE</param>

允许的值:

<param name="maintainers-asc">VALUE</param> 


上述本节内容参考自 obs-service-tar_scm Github 项目页tar_scm.service.in文件