Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

git: up for concord git-client changes #44

Merged
merged 2 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

<scm.connection>scm:git:https://github.com/walmartlabs/concord-plugins.git</scm.connection>

<concord.version>1.71.0</concord.version>
<concord.version>1.78.0</concord.version>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* =====
*/

import com.walmartlabs.concord.repository.FetchRequest;
import com.walmartlabs.concord.repository.GitClientConfiguration;
import com.walmartlabs.concord.repository.ImmutableGitClientConfiguration;
import com.walmartlabs.concord.sdk.Secret;
Expand All @@ -39,15 +40,21 @@ public GitCliClient(boolean shallowClone) {
public void cloneRepo(String uri, String branchName, Secret secret, Path dst) {
ImmutableGitClientConfiguration.Builder cfg = GitClientConfiguration.builder()
.httpLowSpeedLimit(0)
.sshTimeout(Duration.ofSeconds(600))
.shallowClone(shallowClone);
.sshTimeout(Duration.ofSeconds(600));

if (secret instanceof TokenSecret) {
cfg.oauthToken(((TokenSecret) secret).getToken());
secret = null;
}

new com.walmartlabs.concord.repository.GitClient(cfg.build())
.fetch(uri, branchName, null, secret, dst);
.fetch(FetchRequest.builder()
.url(uri)
.version(FetchRequest.Version.from(branchName))
.withCommitInfo(false)
.destination(dst)
.secret(secret)
.shallow(shallowClone)
.build());
}
}