Jump to: navigation, search

Difference between revisions of "Modeling Project Releng/Component Creation/Build Server Setup"

(Add new component)
(Add new component)
Line 10: Line 10:
 
</td></tr></table>
 
</td></tr></table>
  
== Add new component ==
+
== Add new component(s) ==
  
As root or apache:
+
As root:
  
 
<table><tr><td>
 
<table><tr><td>
  
  #!/bin/bash
+
  /usr/sbin/[http://dev.eclipse.org/viewcvs/index.cgi/releng-common/server-config/emft.eclipse.org/addcomponent.sh?root=Modeling_Project&content-type=text%2Fplain&view=co addcomponent] emft servus jcrm ecoretools mint
+
/usr/sbin/[http://dev.eclipse.org/viewcvs/index.cgi/releng-common/server-config/emft.eclipse.org/addcomponent.sh?root=Modeling_Project&content-type=text%2Fplain&view=co addcomponent] mdt ocltools
if <nowiki>[[ $# -lt 2 ]]</nowiki>; then
+
  echo "Usage: $0 projectName newcomponent1 [newcomponent2] [newcomponent3] ...";
+
  echo "Example: $0 emft ecoretools servus mint";
+
  exit;
+
else
+
  projectName=$1; shift 1;
+
fi
+
+
for newcomponent in $*; do # for all commandline args
+
+
  # create build folder
+
  echo "Create /home/www-data/build/modeling/$projectName/$newcomponent/downloads/drops/ ...";
+
  cd /home/www-data/build/modeling/$projectName;
+
  mkdir -p $newcomponent/downloads/drops/;
+
  chown -R apache:apache $newcomponent; chmod -R g+w $newcomponent;
+
+
  # checkout web content
+
  echo "Check out web content into /var/www/html/modeling/$projectName/$newcomponent/ ...";
+
  cd /var/www/html/modeling/$projectName/;
+
  cvs -q up -Pd $newcomponent;
+
  if <nowiki>[[ ! -d /var/www/html/modeling/$projectName/$newcomponent ]]</nowiki>; then
+
    echo "!! NO CVS FOLDER /var/www/html/modeling/$projectName/$newcomponent/ !!";
+
  else
+
    # fix perms
+
    echo "Fix permissions in /var/www/html/modeling/$projectName/$newcomponent/ ...";
+
    cd /var/www/html/modeling/$projectName/$newcomponent;
+
    chown -R nickb:www * .*; chmod -R g+w * .*;
+
+
    # add .htaccess
+
    echo "Set .htaccess protection for /var/www/html/modeling/$projectName/$newcomponent/build/ ...";
+
    cd /var/www/html/modeling/$projectName/$newcomponent/build/;
+
    cp /var/www/html/modeling/$projectName/build/.htaccess .;
+
    chmod 664 .htaccess;
+
+
    # add symlink to downloads
+
    echo "Symlink /var/www/html/modeling/$projectName/$newcomponent/downloads/ ...";
+
    cd /var/www/html/modeling/$projectName/$newcomponent;
+
    ln -s /home/www-data/build/modeling/$projectName/$newcomponent/downloads/;
+
  fi
+
done
+
 
+
  
 
</td></tr></table>
 
</td></tr></table>

Revision as of 14:54, 14 November 2007

Add new user

As root:

for newuser in newuser anotheruser; do \
  /usr/sbin/adduser $newuser; \
  /usr/sbin/usermod -G www -p ${newuser}1 $newuser; \
done

Add new component(s)

As root:

/usr/sbin/addcomponent emft servus jcrm ecoretools mint
/usr/sbin/addcomponent mdt ocltools 

Edit firewall

As root, add a line such as this to the firewall, then reload it.

/sbin/iptables -I INPUT -p tcp -s newhost_or_IP --dport 22 -j ACCEPT # newuser (newcomponent)

Announcement

Finally, send the user an email or IM with his new .htaccess and ssh usernames/passwords.