Examples of GitService


Examples of io.fabric8.git.GitService

    private void updateMasterUrl(Group<GitNode> group) {
        GitNode master = group.master();
        String masterUrl = master != null ? master.getUrl() : null;
        try {
            if (masterUrl != null) {
                GitService gitservice = gitService.get();
                String substitutedUrl = getSubstitutedData(curator.get(), masterUrl);
                if (!Strings.isNotBlank(substitutedUrl)) {
                    LOGGER.warn("Could not render git master URL {}.", masterUrl);
                }
                //Catch any possible issue indicating that the URL is invalid.
                new URL(substitutedUrl);
                gitservice.notifyRemoteChanged(substitutedUrl);
            }
        } catch (Exception e) {
            LOGGER.error("Failed to point origin to the new master.", e);
        }
    }
View Full Code Here

Examples of org.platformlayer.service.git.model.GitService

    String organizationName = "test.platformlayer.org";
    LdapDomain ldapDomain = openLdap.createLdapDomain(ldapService, organizationName);

    String id = "git" + random.randomAlphanumericString(8);

    GitService service = new GitService();
    service.dnsName = id + ".test.platformlayer.org";
    service.ldapGroup = "ou=Git Users,dc=test,dc=platformlayer,dc=org";

    service = putItem(id, service);
    service = waitForHealthy(service);
View Full Code Here

Examples of org.platformlayer.service.git.model.GitService

  LdapDomain ldapDomain;

  LdapDomain getLdapDomain() throws OpsException {
    if (ldapDomain == null) {
      GitService model = OpsContext.get().getInstance(GitService.class);
      LdapDN ldapGroup = LdapDN.parseLdifEncoded(model.ldapGroup);

      LdapDomain best = null;
      for (LdapDomain candidate : platformLayer.listItems(LdapDomain.class)) {
        switch (candidate.getState()) {
View Full Code Here

Examples of org.platformlayer.service.git.model.GitService

  LdapService ldapService;

  LdapService getLdapService() throws OpsException {
    if (ldapService == null) {
      GitService model = OpsContext.get().getInstance(GitService.class);
      // String ldapGroup = model.ldapGroup;

      LdapService best = null;
      for (LdapService candidate : platformLayer.listItems(LdapService.class)) {
        switch (candidate.getState()) {
View Full Code Here

Examples of org.platformlayer.service.git.model.GitService

    return ldapService;
  }

  @Override
  protected void addChildren() throws OpsException {
    GitService model = OpsContext.get().getInstance(GitService.class);

    InstanceBuilder vm = InstanceBuilder.build(model.dnsName, this, model.getTags());
    addChild(vm);

    vm.addChild(PackageDependency.build("apache2"));
    // Provides /usr/lib/git-core/git-http-backend
    vm.addChild(PackageDependency.build("git"));

    vm.addChild(ManagedDirectory.build(new File("/var/git"), "0755"));
    vm.addChild(ApacheModule.build("authnz_ldap"));
    vm.addChild(ApacheModule.build("ldap"));

    File apache2ConfDir = new File("/etc/apache2");

    vm.addChild(TemplatedFile.build(this, new File(apache2ConfDir, "conf.d/git")));

    vm.addChild(ManagedService.build("apache2"));

    vm.addChild(MetricsInstance.class);

    {
      PublicEndpoint endpoint = injected(PublicEndpoint.class);
      // endpoint.network = null;
      endpoint.publicPort = PORT;
      endpoint.backendPort = PORT;
      endpoint.dnsName = model.dnsName;

      endpoint.tagItem = model.getKey();
      endpoint.parentItem = model.getKey();

      vm.addChild(endpoint);
    }
  }
View Full Code Here

Examples of org.platformlayer.service.git.model.GitService

        if (gitServices.size() == 0) {
          throw new OpsException("No git service found");
        }

        GitService gitService = RandomChooser.chooseRandom(gitServices);

        if (gitService == null) {
          throw new IllegalStateException();
        }

        assignedTo = gitService.getKey();
        platformLayer.addTag(model.getKey(), Tag.ASSIGNED_TO.build(assignedTo));
      }
    }

    GitService gitService = null;
    if (assignedTo != null) {
      gitService = platformLayer.getItem(assignedTo, GitService.class);
    }

    if (OpsContext.isDelete()) {
      if (gitService == null) {
        log.info("Deleting, but not assigned to a server; nothing to do");
        getRecursionState().setPreventRecursion(true);
        return;
      }
    }

    if (gitService == null) {
      throw new OpsException("No git servers found");
    }

    if (gitService.getState() != ManagedItemState.ACTIVE) {
      throw new OpsException("Server not yet active: " + gitService);
    }

    Machine machine = instances.findMachine(gitService);
    if (machine == null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.