如何配置命令行SVN的HTTP代理? [英] How do I configure the SVN HTTP proxy from the command line?

查看:637
本文介绍了如何配置命令行SVN的HTTP代理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的脚本我的编译环境的设立。 (所以,如果发现自己一个干净的形象上运行的构建过程可以引导本身)。

作为这一过程的一部分,某些依赖从公共库SVN检索。

构建机器后面坐着一个代理,所以我需要SVN配置为使用代理服务器。

若干那马上想到的是令人不快的各种原因的选项:


  • 我可以编辑〜/的.subversion /服务器手动档,但我很情愿保持制作过程自成体系,并尽可能地自动化。

  • 或者,我可以代理的各种公共颠覆库与一个内部依赖资源库,但这增加了移动需要维护的部件数量。

  • 最后,我可以写一个脚本来检查配置文件并对其进行修改(如果需要),但这似乎是大材小用了什么应该是构建过程中一个微不足道的部分。

理想情况下,我应该能够指定从命令行代理,但它并不明显,这是可能的。什么是解决这个问题的正确方法?


解决方案

SVNBook 到抢救!


  1. 正如你已经提到的,你可以添加SVN配置选项, SVN 命令行客户端。

    请参阅 SVNBook | - 配置选项命令行参考


      

    设定,对命令的持续时间,运行时的值
      配置选项。 CONFSPEC是一个字符串,它指定
      配置选项命名空间,名称和值,你想
      分配,格式为文件:SECTION:OPTION = [VALUE] 。在此语法,FILE
      和部分中运行配置文件(无论是配置还是
      服务器)以及它们的部分,分别包含该
      选择你想改变其值。选项​​是,当然,在
      选项​​本身,和价值值(如果有的话)你想分配给
      选项​​。例如,要暂时禁止使用自动的
      属性设置功能,可使用
      --config选项=配置:杂记:启用的自动道具=无。 您可以使用此选项多次更改多个选项值
      同时,


    下面是示例命令行:

    svn签^ 结果
       - 配置选项服务器:全球:HTTP代理主机= LT; PROXY-HOST> ^ 结果
       - 配置选项服务器:全球:HTTP代理端口=<港口> <回购网址> < LWC-DIR>


  2. 或者使用 - 配置-DIR SVN 命令行客户端指向自定义配置文件

    - 配置-DIR DIR


      

    指示颠覆读取的配置信息
      指定的目录,而不是默认位置(在的.subversion
      用户的主目录)。



I script the set up of my build environment. (So the build process can bootstrap itself if it finds itself running on a clean image).

As part of this process, certain dependencies are retrieved from public SVN repositories.

The build machines sit behind a proxy, so I need to configure SVN to use the proxy.

Several of the options that come immediately to mind are unpalatable for various reasons:

  • I could edit the ~/.subversion/servers file manually, but I would far rather keep the build process as self-contained and as automated as possible.
  • Alternatively, I could "proxy" the various public subversion repositories with an internal "dependencies" repository, but this adds to the number of moving parts that need to be maintained.
  • Finally, I could write a script to check the configuration file and modify it (if needed), but this seems like overkill for what should be a trivial part of the build process.

Ideally, I should be able to specify the proxy from the command line, but it is not obvious that this is possible. What is the right way to approach this problem?

解决方案

SVNBook to the rescue!

  1. As you've already mentioned, you can add SVN configuration options to svn command-line client.

    See SVNBook | --config-option command-line reference.

    Sets, for the duration of the command, the value of a runtime configuration option. CONFSPEC is a string which specifies the configuration option namespace, name and value that you'd like to assign, formatted as FILE:SECTION:OPTION=[VALUE]. In this syntax, FILE and SECTION are the runtime configuration file (either config or servers) and the section thereof, respectively, which contain the option whose value you wish to change. OPTION is, of course, the option itself, and VALUE the value (if any) you wish to assign to the option. For example, to temporarily disable the use of the automatic property setting feature, use --config-option=config:miscellany:enable-auto-props=no. You can use this option multiple times to change multiple option values simultaneously.

    Here is the sample command-line:

    svn checkout ^
    --config-option servers:global:http-proxy-host=<PROXY-HOST> ^
    --config-option servers:global:http-proxy-port=<PORT> <REPO-URL> <LWC-DIR>

  2. Or use --config-dir to point svn command-line client to customized configuration file.

    --config-dir DIR

    Instructs Subversion to read configuration information from the specified directory instead of the default location (.subversion in the user's home directory).

这篇关于如何配置命令行SVN的HTTP代理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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