Blame Manuals/Tcar-ug/Repository/Workstation/config.docbook

d2638e
<sect1 id="repo-ws-config">
eebdc3
eebdc3
    <title>Configuring Your Workstation</title>
eebdc3
eebdc3
    <para>
9c8948
        Once your worstation has been installed, it is time for you to
9c8948
        configure it. The configuration of your workstation consists
9c8948
        on defining your workplace, download a working copy from
9c8948
        &TCAR; and finally, run the <function>prepare</function>
9c8948
        functionality of <command>centos-art.sh</command> script to
9c8948
        install/update the software needed, as well as render images,
9c8948
        links, and anything else needed.
eebdc3
    </para>
eebdc3
d2638e
    <sect2 id="repo-ws-config-wp">
74d256
    <title>Define Your Workplace</title>
eebdc3
    <para>
eebdc3
        Once you've installed the workstation and it is up and
74d256
        running, you need to register the user name you'll use for
74d256
        working. In this task you need to use the commands
eebdc3
        <command>useradd</command> and <command>passwd</command> to
eebdc3
        create the user name and set a password for it, respectively.
eebdc3
        These commands require administrative privileges to be
eebdc3
        executed, so you need to login as <emphasis>root</emphasis>
eebdc3
        superuser for doing so. 
eebdc3
    </para>
eebdc3
eebdc3
    <caution>
eebdc3
    <para>
74d256
        Do not use the <emphasis>root</emphasis> username for regular
74d256
        tasks inside your working copy of &TCAR;.  This is dangerous
74d256
        and might provoke unreversable damages to your workstation.
eebdc3
    </para>
eebdc3
    </caution>
eebdc3
eebdc3
    <para>
74d256
        When you've registered your user name in the workstation, it
74d256
        provides an identifier for you to open a user's session in the
74d256
        workstation and a place to store the information you produce,
74d256
        as well. This place is known as your home directory and is
74d256
        unique for each user registered in the workstation. For
74d256
        example, if you register the user name john in your
74d256
        workstation, your home directory would be located at 
74d256
        class="directory">/home/john/</filename>.
74d256
    </para>
74d256
    
74d256
    <para>
a382c3
        At this point it is important to define where to download the
a382c3
        working copy of &TCAR; inside your home directory.  This
a382c3
        desition deserves special attention and should be implemented
a382c3
        carefully in order to grant a standard environment that can be
a382c3
        distributed.  Let's see some alternatives.
eebdc3
    </para>
eebdc3
74d256
    <sect3>
74d256
    <title>Different Absolute Paths</title>
eebdc3
    <para>
74d256
        Consider that you store your working copy under 
74d256
        class="directory">/home/john/Projects/artwork/</filename> and
74d256
        I store mine under 
74d256
        class="directory">/home/al/Projects/artwork/</filename>, we'll
74d256
        end up refering the same files inside our working copies
a382c3
        through different absolute paths.  This alternative generates
a382c3
        a contradiction when files which hold path information inside
a382c3
        are committed up to the central repository from different
a382c3
        working copies. The contradiction comes from the question:
a382c3
        which is the correct absolute path to use inside such files,
a382c3
        yours or mine? (None of them is, of course.)
74d256
    </para>
74d256
74d256
    </sect3>
eebdc3
74d256
    <sect3 id="repo-ws-config-wp-OneUniqueAbsolutePath">
74d256
    <title>One Unique Absolute Path</title>
eebdc3
    <para>
c03f46
        Another case would be that where you and I ourselves use one
c03f46
        unique home directory (e.g., 
74d256
        class="directory">/home/centos/Projects/artwork/</filename>)
74d256
        to store the working copy of &TCAR; in our own workstations,
74d256
        but configure the subversion client to use different user
74d256
        names to commit changes up from the working copy to the
a382c3
        central repository.  This alternative might be not so good in
a382c3
        situations where you and I have to share the same workstation.
a382c3
        In such cases, it would be required that we both share the
a382c3
        password information of the same system user (the
a382c3
        <emphasis>centos</emphasis> user in our example) which, in
a382c3
        addition, gives access to that user's subversion client
a382c3
        configuration and this way provokes the whole sense of using
a382c3
        different subversion credentials for committing changes to be
a382c3
        lost.
74d256
    </para>
74d256
    </sect3>
eebdc3
74d256
    <sect3>
74d256
    <title>Different Absolute Paths Through Dynamic Expansion</title>
eebdc3
    <para>
74d256
        Most of the absolute paths we use inside the working copy are
74d256
        made of two parts, one dynamic and one relative fixed. The
74d256
        dynamic part is the home directory of the current user and its
74d256
        value can be retrived from the <envar>$HOME</envar>
74d256
        environment variable.  The fixed part of the path is the one
74d256
        we set inside the repositroy structure itself as a matter of
74d256
        organization.  What we need here is to find a way to expand
74d256
        variables inside files that don't support variable expansion.
74d256
        This alternative had worked rather fine when we produce
a382c3
        produce PNG files from SVG files and XTHML from DocBook files,
a382c3
        but the same is not true for absolute paths inside files that
a382c3
        are used as in their permanent state inside the repository
a382c3
        (e.g., CSS files and other files similar in purpose).
eebdc3
    </para>
74d256
    </sect3>
74d256
74d256
    </sect2>
74d256
74d256
    <sect2 id="repo-ws-config-wc">
74d256
    <title>Download Your Working Copy</title>
74d256
74d256
    <para>
74d256
        As convenction, to use the &TCAR;, you must register the user
74d256
        name <emphasis>centos</emphasis> in your workstation, do login
74d256
        with it, and download the working copy from the central
74d256
        repository using the following command:
74d256
    </para>
74d256
74d256
    <screen>svn co https://projects.centos.org/svn/artwork /home/centos/Projects/artwork</screen>
c03f46
eebdc3
    <para>
74d256
        The first time you download the working copy it contains no
74d256
        image files, nor documentation, or localized content inside
74d256
        it. This is because all the files provided in the working copy
74d256
        are source files (e.g., the files needed to produce other
74d256
        files) and it is up to you the action of render them to
74d256
        produce the final files (e.g., images and documentation) used
74d256
        to implement &TCPCVI;. 
eebdc3
    </para>
eebdc3
9c8948
    </sect2>
9c8948
9c8948
    <sect2 id="repo-ws-config-sudoers">
9c8948
    <title>Configure Administrative Tasks</title>
9c8948
9c8948
    <para>
9c8948
        Most of the administrative tasks you need to perform in your
9c8948
        working copy of &TCAR; are standardized inside the
9c8948
        <function>prepare</function> functionality of
9c8948
        <command>centos-art.sh</command> script. Inside
9c8948
        <command>centos-art.sh</command>
9c8948
        script, all administrative task are invoked trough the
9c8948
        <command>sudo</command> command. Thus, in order for the
9c8948
        <command>centos-art.sh</command> script to perform
9c8948
        administrative tasks, you need to update the
9c8948
        <command>sudo</command>'s configuration in a way that such
9c8948
        administrative actions be allowed.
9c8948
    </para>
9c8948
9c8948
    <para>
9c8948
        At time of this writing the <command>centos-art.sh</command>
9c8948
        script implements just one administrative task, that is
9c8948
        package management.  Nevertheless, in the future, other
9c8948
        administrative tasks might be included as well.
9c8948
    </para>
9c8948
eebdc3
    <para>
9c8948
       To update the <command>sudo</command>'s configuration, execute
9c8948
       the <command>visudo</command> command as <quote>root</quote>.
9c8948
       Later, uncoment the <varname>Cmnd_Alias</varname> related to
9c8948
       <quote>SOFTWARE</quote> and add a line for
9c8948
       <quote>centos</quote> username allowing software commands. This
9c8948
       configuration is illustrated in 
9c8948
       linkend="repo-ws-config-sudoers-example" />.
eebdc3
    </para>
eebdc3
9c8948
    <example id="repo-ws-config-sudoers-example">
9c8948
    <title>The <filename>/etc/sudoers</filename> configuration file</title>
9c8948
    <screenshot>
9c8948
    <screeninfo><filename>/etc/sudoers</filename> configuration file</screeninfo>
9c8948
    <mediaobject>
9c8948
    <textobject>
9c8948
<programlisting>
9c8948
## Installation and management of software
9c8948
Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum
9c8948
9c8948
## Next comes the main part: which users can run what software on
9c8948
## which machines (the sudoers file can be shared between multiple
9c8948
## systems).
9c8948
## Syntax:
9c8948
##
9c8948
##      user    MACHINE=COMMANDS
9c8948
##
9c8948
## The COMMANDS section may have other options added to it.
9c8948
##
9c8948
## Allow root to run any commands anywhere
9c8948
root    ALL=(ALL)       ALL
9c8948
9c8948
## Allow the centos user to run installation and management of
9c8948
## software anywhere.
9c8948
centos  ALL=(ALL)       SOFTWARE
9c8948
</programlisting>
9c8948
    </textobject>
9c8948
    </mediaobject>
9c8948
    </screenshot>
9c8948
    </example>
9c8948
    
9c8948
    </sect2>
9c8948
9c8948
    <sect2 id="repo-ws-config-runout">
9c8948
    <title>Run Automation Tool</title>
9c8948
    <para>
9c8948
        Once you've created the <quote>centos</quote> username, logged
9c8948
        in with it, downloaded a working copy from &TCAR; and
9c8948
        configured the <command>sudo</command>'s configuration file,
9c8948
        run the <function>prepare</function> functionality of
9c8948
        <command>centos-art.sh</command> script to complete the
9c8948
        configuration process using the following command:
9c8948
    </para>
9c8948
9c8948
    <screen>/home/centos/Projects/artwork/trunk/Scripts/Bash/centos-art.sh prepare</screen>
9c8948
9c8948
    <para>
9c8948
        To know more about the <function>prepare</function>
9c8948
        functionality of <command>centos-art.sh</command> script, see
9c8948
        <xref linkend="scripts-bash-prepare" />.
9c8948
    </para>
eebdc3
    </sect2>
eebdc3
eebdc3
</sect1>