Search in sources :

Example 1 with GitlabService

use of org.platformlayer.service.gitlab.model.GitlabService in project platformlayer by platformlayer.

the class GitlabServiceController method addChildren.

@Override
protected void addChildren() throws OpsException {
    GitlabService model = OpsContext.get().getInstance(GitlabService.class);
    InstanceBuilder instance = InstanceBuilder.build(model.dnsName, this, model.getTags());
    addChild(instance);
    instance.addChildren(PackageDependency.build(Splitter.on(" ").split("sudo git-core wget curl gcc checkinstall libxml2-dev libxslt-dev sqlite3 libsqlite3-dev libcurl4-openssl-dev libreadline-dev libc6-dev libssl-dev libmysql++-dev make build-essential zlib1g-dev libicu-dev redis-server openssh-server git-core python-dev python-pip sendmail")));
    {
        PosixGroup group = injected(PosixGroup.class);
        group.groupName = "git";
        instance.addChild(group);
    }
    {
        PosixUser user = injected(PosixUser.class);
        user.userName = "git";
        user.primaryGroup = "git";
        instance.addChild(user);
    }
    {
        PosixUser user = injected(PosixUser.class);
        user.userName = "gitlab";
        user.secondaryGroups.add("sudo");
        user.secondaryGroups.add("git");
        instance.addChild(user);
    }
    // sudo -H -u gitlab ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa
    instance.addChild(PackageDependency.build("ruby1.9.1"));
    {
        GitCheckout checkout = injected(GitCheckout.class);
        checkout.targetDir = new File("/opt/gitlabhq");
        checkout.source = "https://github.com/gitlabhq/gitlabhq.git";
        instance.addChild(checkout);
    }
    {
        GitCheckout checkout = injected(GitCheckout.class);
        checkout.targetDir = new File("/opt/gitolite");
        checkout.source = "https://github.com/gitlabhq/gitolite.git";
        instance.addChild(checkout);
    }
// Eeek... we have to run a gitolite install script.
// I don't fancy picking it apart right now...
// As gitlabhq...
// git config --global user.email "admin@local.host"
// git config --global user.name "GitLabHQ Admin User"
// su -c "ssh-keygen -q -f /home/gitlabhq/.ssh/id_rsa -N ''" gitlabhq
}
Also used : PosixGroup(org.platformlayer.ops.users.PosixGroup) GitlabService(org.platformlayer.service.gitlab.model.GitlabService) PosixUser(org.platformlayer.ops.users.PosixUser) File(java.io.File) InstanceBuilder(org.platformlayer.ops.instances.InstanceBuilder)

Aggregations

File (java.io.File)1 InstanceBuilder (org.platformlayer.ops.instances.InstanceBuilder)1 PosixGroup (org.platformlayer.ops.users.PosixGroup)1 PosixUser (org.platformlayer.ops.users.PosixUser)1 GitlabService (org.platformlayer.service.gitlab.model.GitlabService)1