SVN离线获取最后的提交信息 [英] SVN get the last commit message offline

查看:617
本文介绍了SVN离线获取最后的提交信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在没有访问回购的情况下获取最后的提交消息? svn log --limit 1 尝试连接到回购。

Is there a way to get the last commit message without access to the repo? svn log --limit 1 tries to connect to the repo.

编辑:我有凭据设置并使用它们来查看源代码。

I have credentials setup and using them to check out the source.

我正在尝试要实现,就是让詹金斯根据提交消息触发另一个工作,即它是否包含字符串#build开始工作X.我的尝试是在Shell Build Step中解析它,并根据其结果执行作业。但由于我没有匿名访问repo,也不想在shell脚本中嵌入凭据,所以我不知道如何实现这一点。

What I'm trying to achieve, is to get Jenkins triggering another job depending on the commit message, i.e. if it contains the string "#build" start job X. My attempt was to parse it in a Shell Build Step and execute a job depending on its outcome. But since I don't have anonymous access to the repo and don't want to embed credentials in the shell script, I have no idea how to achieve this.

接下来是git ..

Next would be git..

推荐答案

a href =https://wiki.jenkins-ci.org/display/JENKINS/Credentials+Plugin =nofollow> Jenkins Credentials 插件适用于

This is what Jenkins Credentials plugin is for.

您可以在Jenkins Global Configuration上安全地配置凭据,并让作业参考该凭据。无需在脚本中写入任何内容。

You configure credentials securely on Jenkins Global Configuration, and let the job reference that. No need to write anything in the script.

编辑:

要安全使用来自外壳步骤的密码


To securely use a password from within a shell step


  • 安装 EnvInject插件 Jenkins全局配置 strong>全局密码部分。

  • 添加名称(这将是环境变量名称)和密码将被加星标****)。

  • 作业配置下,找到构建环境部分。 b
  • 选中标记将构建密码注入为环境变量
  • 。然后选中全局密码。 $ b
  • Install EnvInject plugin.
  • Under Jenkins Global Configuration, find Global Passwords section.
  • Add a name (this will be the environment variable name) and password (will be starred **** ).
  • Under Job Configuration, find Build Environment section.
  • Checkmark Inject passwords to the build as environment variables.
  • Then checkmark Global passwords.

在任何构建步骤中,现在可以使用 $ name (如前所定义)来引用密码就像你打字时一样以纯文本形式。

In any build step, you can now use $name (as defined earlier) to refer to a password as you would if you were typing it in plain text.


  • 密码变量仅在作业执行时注入(键入 $ name 在服务器的命令行上本身不会产生任何东西,并且和所有Jenkins变量一样,它不是持久的)。
  • 作业控制台日志将显示 **** ,而不是密码(如果显示)。
  • 您可以为每个作业配置密码,而不是全局配置,以便其他作业无法使用

  • The password variable is injected only at job execution time (typing $name on command line of the server by itself will not produce anything, and like all Jenkins variables, it is not persistent).
  • The job console log will show **** instead of password, if it appears.
  • You could configure passwords per job, rather than globally, so that other jobs can't use it.

唯一的安全问题是,如果有人有管理权限来配置您的工作,他们可以写 echo $ name> secretpassword.txt 到构建步骤中,然后在工作区中查看该文件。但是,您应该小心为您分配管理权限。

The only security concern is that if someone has administrative permissions to configure your job, they can write echo $name > secretpassword.txt into a build step, and then review the file in the workspace. But you should be careful who you assign administrative rights to.

这篇关于SVN离线获取最后的提交信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆