use of org.platformlayer.ops.users.PosixGroup 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
}
Aggregations