How do I configure the SVN HTTP proxy from the command line?

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.

  • TFS Labels in a Build Continuous Environment with Jenkins
  • Jenkins - How can i pass parameters from the Upstream to Downstream
  • Exclude directory during jenkins checkout
  • Create job in jenkins with calling svn and maven
  • Repo sync fails to initialize CM13 work tree
  • Configure a Jenkins job to select an application and trunk/tags/branches from SVN
  • 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?

  • Run a command shell in jenkins
  • Queue build for non-default branch with git and VS
  • How to properly use CI scripts with Git hooks to compress source
  • Best practice - Git + Build automation - Keeping configs separate
  • CMake ExternalProject: how to specify relative path to the root CMakeLists.txt?
  • Connect Github to secured Jenkins via HTTP Post-Commit Hook
  • One Solution collect form web for “How do I configure the SVN HTTP proxy from the command line?”

    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).

    Git Baby is a git and github fan, let's start git clone.