Package com.groupon.jenkins.github

Examples of com.groupon.jenkins.github.GitUrl


        }
        return isRepoMember(a);
    }

    private boolean isRepoMember(GithubAuthenticationToken authentication) {
        String repoName = new GitUrl(project.getGithubRepoUrl()).getFullRepoName();
        return authentication.hasRepositoryPermission(repoName);
    }
View Full Code Here


        }
    }

    private synchronized GHRepository getRepository() {
        if (repository == null) {
            String fullRepoName = new GitUrl(repoUrl).getFullRepoName();
            try {
                repository = getGithub().getRepository(fullRepoName);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
View Full Code Here

import java.util.Map;
import static java.lang.String.format;

public class CheckoutCommands {
    public static ShellCommands get(Map<String, String> dotCiEnvVars) {
        GitUrl gitRepoUrl = new GitUrl(dotCiEnvVars.get("GIT_URL"));
        String gitUrl = gitRepoUrl.getHttpsUrl();
        String checkoutLocation = format("/var/%s",gitRepoUrl.getFullRepoName());
        ShellCommands shellCommands = new ShellCommands();
        if(dotCiEnvVars.get("DOTCI_PULL_REQUEST") != null){
            shellCommands.add(format("git clone  --depth=50 %s %s",gitUrl,checkoutLocation));
            shellCommands.add("cd " + checkoutLocation);
            shellCommands.add(format("git fetch origin \"+refs/pull/%s/merge:\"", dotCiEnvVars.get("DOTCI_PULL_REQUEST")));
View Full Code Here

    }

    public Map<String, String> getDotCiEnvVars() {
        Map<String, String> vars = new HashMap<String, String>();
        vars.put("SHA", build.getSha());
        vars.put("GIT_URL", new GitUrl(build.getParent().getGithubRepoUrl()).getUrl());
        return vars;
    }
View Full Code Here

TOP

Related Classes of com.groupon.jenkins.github.GitUrl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.