Package org.platformlayer.service.git.model

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


  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

  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

    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

        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

Related Classes of org.platformlayer.service.git.model.GitService

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.