svn查看日志提示离线_SVN离线获取最后的提交信息

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.

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

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.

Next would be git..

解决方案

This is what Jenkins Credentials plugin is for.

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

Edit:

To securely use a password from within a shell step

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.

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.

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.

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值