From 13037cbd0d8131dd05fe2eae92e8a5156807ff5c Mon Sep 17 00:00:00 2001 From: Priti Desai Date: Thu, 19 Mar 2020 11:10:06 -0700 Subject: [PATCH] adding proxy settings to git-clone Adding httpsProxy, httpProxy, and noProxy in git-clone task. --- git/README.md | 3 +++ git/git-clone.yaml | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/git/README.md b/git/README.md index 32be6410..e8936603 100644 --- a/git/README.md +++ b/git/README.md @@ -38,6 +38,9 @@ as well as * **sslVerify**: defines if http.sslVerify should be set to true or false in the global git config (_default_: true) * **subdirectory**: subdirectory inside the "output" workspace to clone the git repo into (_default:_ src) * **deleteExisting**: clean out the contents of the repo's destination directory if it already exists before cloning the repo there (_default_: false) +* **httpProxy**: git HTTP proxy server for non-SSL requests +* **httpsProxy**: git HTTPS proxy server for SSL requests +* **noProxy**: git no proxy - opt out of proxying HTTP/HTTPS requests ### Results diff --git a/git/git-clone.yaml b/git/git-clone.yaml index b32c15d1..bd81c486 100644 --- a/git/git-clone.yaml +++ b/git/git-clone.yaml @@ -35,6 +35,18 @@ spec: description: clean out the contents of the repo's destination directory (if it already exists) before trying to clone the repo there type: string default: "false" + - name: httpProxy + description: git HTTP proxy server for non-SSL requests + type: string + default: "" + - name: httpsProxy + description: git HTTPS proxy server for SSL requests + type: string + default: "" + - name: noProxy + description: git no proxy - opt out of proxying HTTP/HTTPS requests + type: string + default: "" results: - name: commit description: The precise commit SHA that was fetched by this Task @@ -63,6 +75,10 @@ spec: cleandir fi + test -z "$(inputs.params.httpProxy)" || export HTTP_PROXY=$(inputs.params.httpProxy) + test -z "$(inputs.params.httpsProxy)" || export HTTPS_PROXY=$(inputs.params.httpsProxy) + test -z "$(inputs.params.noProxy)" || export NO_PROXY=$(inputs.params.noProxy) + /ko-app/git-init \ -url "$(inputs.params.url)" \ -revision "$(inputs.params.revision)" \