diff --git a/README.md b/README.md index ccd6f6e0..7895b2fa 100644 --- a/README.md +++ b/README.md @@ -52,10 +52,10 @@ Tracks the commits in a [git](http://git-scm.com/) repository. the `branch`. Patterns are [glob(7)](http://man7.org/linux/man-pages/man7/glob.7.html) compatible (as in, bash compatible). -* `submodules`: *Optional.* List of credentials for HTTP(s) auth when pulling/pushing private git submodules which are not stored in the same git server as the container repository. +* `submodule_credentials`: *Optional.* List of credentials for HTTP(s) auth when pulling/pushing private git submodules which are not stored in the same git server as the container repository. Example: ``` - submodules: + submodule_credentials: - host: github.com username: git-user password: git-password @@ -144,7 +144,7 @@ resources: source: uri: git@github.com:concourse/git-resource.git branch: master - submodules: + submodule_credentials: - host: some.other.git.server username: user password: verysecurepassword diff --git a/assets/common.sh b/assets/common.sh index eac2282e..0d6a1df4 100644 --- a/assets/common.sh +++ b/assets/common.sh @@ -163,14 +163,14 @@ git_metadata() { configure_submodule_credentials() { local username local password - if [[ "$(jq -r '.source.submodules // ""' < "$1")" == "" ]]; then + if [[ "$(jq -r '.source.submodule_credentials // ""' < "$1")" == "" ]]; then return fi - for k in $(jq -r '.source.submodules | keys | .[]' < "$1"); do - host=$(jq -r --argjson k "$k" '.source.submodules[$k].host // ""' < "$1") - username=$(jq -r --argjson k "$k" '.source.submodules[$k].username // ""' < "$1") - password=$(jq -r --argjson k "$k" '.source.submodules[$k].password // ""' < "$1") + for k in $(jq -r '.source.submodule_credentials | keys | .[]' < "$1"); do + host=$(jq -r --argjson k "$k" '.source.submodule_credentials[$k].host // ""' < "$1") + username=$(jq -r --argjson k "$k" '.source.submodule_credentials[$k].username // ""' < "$1") + password=$(jq -r --argjson k "$k" '.source.submodule_credentials[$k].password // ""' < "$1") if [ "$username" != "" -a "$password" != "" -a "$host" != "" ]; then echo "machine $host login $username password $password" >> "${HOME}/.netrc" fi diff --git a/test/helpers.sh b/test/helpers.sh index fe05e6d9..ff238f1f 100644 --- a/test/helpers.sh +++ b/test/helpers.sh @@ -299,7 +299,7 @@ check_uri_with_submodule_credentials() { uri: $(echo $1 | jq -R .), username: $(echo $2 | jq -R .), password: $(echo $3 | jq -R .), - submodules: [ + submodule_credentials: [ { host: $(echo $4 | jq -R .), username: $(echo $5 | jq -R .),