Blame Automation/Manuals/centos-art.sh.asciidoc

Alain Reguera Delgado 0de111
centos-art.sh(1)
Alain Reguera Delgado 0de111
================
Alain Reguera Delgado 0de111
Alain Reguera Delgado 954d94
Name
Alain Reguera Delgado 0de111
----
Alain Reguera Delgado 2e37b0
Alain Reguera Delgado daf412
centos-art.sh - The CentOS artwork repository automation tool.
Alain Reguera Delgado 0de111
Alain Reguera Delgado 954d94
Synopsis
Alain Reguera Delgado 0de111
--------
Alain Reguera Delgado 2e37b0
Alain Reguera Delgado 954d94
*centos-art.sh* [*--help*|*--version*]::
Alain Reguera Delgado daf412
    Print information about *centos-art.sh* script itself.
Alain Reguera Delgado 0de111
Alain Reguera Delgado 954d94
*centos-art.sh* *MODULE* [*--help|--version*]::
Alain Reguera Delgado daf412
    Print information about the specified module. See <<modules>>
Alain Reguera Delgado daf412
    below to see which modules are available inside the
Alain Reguera Delgado daf412
    *centos-art.sh* script.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
Description
Alain Reguera Delgado 0de111
-----------
Alain Reguera Delgado 2e37b0
Alain Reguera Delgado 954d94
*centos-art.sh* exists to standardize frequent tasks inside the CentOS
Alain Reguera Delgado 954d94
repository.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
When you execute the *centos-art.sh* script in a terminal, it will
Alain Reguera Delgado 954d94
request the absolute path where you stored your working copy of CentOS
Alain Reguera Delgado 954d94
artwork repository.  To avoid the absolute path request every time you
Alain Reguera Delgado 5824c8
execute the script, you can edit the +~/.bash_profile+ file and
Alain Reguera Delgado 5824c8
declare the absolute path to your working copy there, as value to
Alain Reguera Delgado 954d94
TCAR_BASEDIR variable.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 5824c8
Once *centos-art.sh* script knows what the absolute path to your
Alain Reguera Delgado 5824c8
working copy is, it executes the file *centos-art.conf* to load
Alain Reguera Delgado 5824c8
default values to configuration variables into its execution
Alain Reguera Delgado 5824c8
environment.  After configuration variables have been loaded in the
Alain Reguera Delgado 5824c8
execution environment, the script looks for supported options in the
Alain Reguera Delgado 5824c8
first argument. If the options passed are recognized the script
Alain Reguera Delgado 5824c8
process them. If the options aren't recognized or no option is passed
Alain Reguera Delgado 5824c8
at all, the *centos-art.sh* script exports common functions and
Alain Reguera Delgado 5824c8
executes the module specified as first argument, assuming the first
Alain Reguera Delgado 5824c8
argument is a valid module name of course.  Finally, the
Alain Reguera Delgado 2e37b0
*centos-art.sh* script waits for the module environment to conclude
Alain Reguera Delgado daf412
their job and exits, as described in <<exit-status>>.
Alain Reguera Delgado 954d94
Alain Reguera Delgado daf412
[[exit-status]]
Alain Reguera Delgado 954d94
Exit Status
Alain Reguera Delgado 954d94
-----------
Alain Reguera Delgado daf412
Alain Reguera Delgado 954d94
 * 0 -- Exit successfully without errors.
Alain Reguera Delgado 954d94
 * 1 -- Exit with errors.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 2e37b0
[[modules]]
Alain Reguera Delgado 954d94
Modules
Alain Reguera Delgado 954d94
-------
Alain Reguera Delgado 2e37b0
From version 0.5, the *centos-art.sh* script was redesigned to
Alain Reguera Delgado 2e37b0
introduce the idea of modules to its base design. Modules are
Alain Reguera Delgado 2e37b0
individual execution environments that may nest themselves one inside
Alain Reguera Delgado 2e37b0
another efficiently to achieve high levels maintainability and
Alain Reguera Delgado 2e37b0
extensibility.  This make possible for modules to divide big tasks
Alain Reguera Delgado 2e37b0
into smaller tasks that can be easier to debug, maintain and share
Alain Reguera Delgado 2e37b0
with other modules efficiently (e.g., instead of loading modules all
Alain Reguera Delgado 2e37b0
at once, they are only loaded at demand and unset once they conclude
Alain Reguera Delgado 2e37b0
their execution).
Alain Reguera Delgado 2e37b0
Alain Reguera Delgado 2e37b0
The following modules are available from the *centos-art.sh* script
Alain Reguera Delgado 2e37b0
command-line:
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
*prepare*::
Alain Reguera Delgado 954d94
    This module standardizes configuration tasks needed by your
Alain Reguera Delgado 49bab3
    working copy (e.g., verify whether required packages are installed
Alain Reguera Delgado 2e37b0
    or not in your workstation, calls render module to produce images
Alain Reguera Delgado 2e37b0
    and manuals in the correct order). This is the first task you
Alain Reguera Delgado 2e37b0
    should run in your workstation, just after downloading a fresh
Alain Reguera Delgado 2e37b0
    working copy of CentOS artwork repository.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
*render*::
Alain Reguera Delgado 954d94
    This module standardizes the way content is produced inside the
Alain Reguera Delgado 49bab3
    repository. This function relies on configuration files to do its
Alain Reguera Delgado 49bab3
    work. Whenever you need to produce images, documentation or
Alain Reguera Delgado 954d94
    localized content this is the module you'll need to use.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
*locale*::
Alain Reguera Delgado 954d94
    This module standardizes the way translatable strings are
Alain Reguera Delgado 954d94
    retrieved from source files and put into portable objects for you
Alain Reguera Delgado 954d94
    to edit.  Portable objects produced by this module are used by
Alain Reguera Delgado 954d94
    *render* module to produce localized content.  Whenever you need
Alain Reguera Delgado 954d94
    to produce the intermediate files holding the translatable strings
Alain Reguera Delgado 954d94
    required to produce localized content, use this module.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
*help*::
Alain Reguera Delgado 2e37b0
    This module standardizes they way module's documentation is
Alain Reguera Delgado 2e37b0
    retrieved from their respective locations inside the repository.
Alain Reguera Delgado 2e37b0
    Use this module whenever you need help about the *centos-art.sh*
Alain Reguera Delgado 2e37b0
    script and its modules.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
*tuneup*::
Alain Reguera Delgado 954d94
    This module standardizes maintenance tasks frequently run inside
Alain Reguera Delgado 954d94
    the repository.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
*pack*::
Alain Reguera Delgado 2e37b0
    *Not implemented, yet.* This module standardizes the way RPM
Alain Reguera Delgado 2e37b0
    packages are produced from content available in the repository.
Alain Reguera Delgado 2e37b0
    When ever you need to produce RPM packages with information
Alain Reguera Delgado 2e37b0
    available in the repository, use this module.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
Directory Structure
Alain Reguera Delgado 954d94
~~~~~~~~~~~~~~~~~~~
Alain Reguera Delgado 954d94
Inside the repository, modules related to *centos-art.sh* script are
Alain Reguera Delgado 2e37b0
stored in the directory +Automation/Modules/${MODULE_NAME}/+.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
*Modules/*::
Alain Reguera Delgado 954d94
    This directory contains module's modules.
Alain Reguera Delgado 954d94
*Manuals/*::
Alain Reguera Delgado e08529
    This directory contains module's documentation produced by *help*
Alain Reguera Delgado e08529
    module.  The structure of this directory looks as follow:
Alain Reguera Delgado 954d94
+
Alain Reguera Delgado 5824c8
----------------------------------------------------------------------
Alain Reguera Delgado 954d94
Manuals/
Alain Reguera Delgado 954d94
|-- ${LANG}/
Alain Reguera Delgado 954d94
|   |-- man${SECTION_NUMBER}
Alain Reguera Delgado 954d94
|   `-- ${MODULE_NAME}.${SECTION_NUMBER}
Alain Reguera Delgado 954d94
`-- man${SECTION_NUMBER}
Alain Reguera Delgado 954d94
    `-- ${MODULE_NAME}.${SECTION_NUMBER}
Alain Reguera Delgado 5824c8
----------------------------------------------------------------------
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
*Locales/*::
Alain Reguera Delgado e08529
    This directory contains module's translations produced by *locale*
Alain Reguera Delgado e08529
    module. The structure of this directory looks as follow:
Alain Reguera Delgado 954d94
+
Alain Reguera Delgado 5824c8
----------------------------------------------------------------------
Alain Reguera Delgado 954d94
Locales/
Alain Reguera Delgado 954d94
`-- ${LANG}/
Alain Reguera Delgado 954d94
    |-- LC_MESSAGES
Alain Reguera Delgado 5824c8
    |   |-- ${MODULE_NAME}.sh.mo
Alain Reguera Delgado 5824c8
    |   `-- ${MODULE_NAME}.docbook.mo
Alain Reguera Delgado 954d94
    |-- ${MODULE_NAME}.sh.po
Alain Reguera Delgado 954d94
    |-- ${MODULE_NAME}.sh.pot
Alain Reguera Delgado 5824c8
    |-- ${MODULE_NAME}.docbook.po
Alain Reguera Delgado 5824c8
    `-- ${MODULE_NAME}.docbook.pot
Alain Reguera Delgado 5824c8
----------------------------------------------------------------------
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
*Scripts/*::
Alain Reguera Delgado e08529
    This directory contains function scripts written by module's
Alain Reguera Delgado 5824c8
    writers. Here is where all the tasks the module is useful for are
Alain Reguera Delgado 5824c8
    written and stored in.  As convention the following structure is
Alain Reguera Delgado e08529
    used:
Alain Reguera Delgado 954d94
+
Alain Reguera Delgado 5824c8
----------------------------------------------------------------------
Alain Reguera Delgado 954d94
Scripts/
Alain Reguera Delgado 954d94
`-- ${MODULE_NAME}_${FUNCTION_NAME}.sh
Alain Reguera Delgado 5824c8
----------------------------------------------------------------------
Alain Reguera Delgado 954d94
+
Alain Reguera Delgado 954d94
{asccidoc-br}
Alain Reguera Delgado 954d94
+
Alain Reguera Delgado 954d94
Inside each function script, there is a top comment where you should
Alain Reguera Delgado 954d94
put the name of the function script, a brief description about what it
Alain Reguera Delgado 954d94
does, as well as author and copying information. After the top comment
Alain Reguera Delgado 954d94
and separated by one white line, you should define the function
Alain Reguera Delgado 954d94
sentence using the long format.
Alain Reguera Delgado 954d94
+
Alain Reguera Delgado 5824c8
----------------------------------------------------------------------
Alain Reguera Delgado 954d94
#!/bin/bash
Alain Reguera Delgado 5824c8
######################################################################
Alain Reguera Delgado 954d94
#
Alain Reguera Delgado 954d94
#   ${MODULE_NAME}_${FUNCTION_NAME}.sh -- ${FUNCTION_DESCRIPTION}
Alain Reguera Delgado 954d94
#
Alain Reguera Delgado 954d94
#   Written by:
Alain Reguera Delgado 954d94
#   * ${AUTHOR_NAME} <${AUTHOR_EMAIL}>, ${YEARS}
Alain Reguera Delgado 954d94
#
Alain Reguera Delgado 954d94
# Copyright (C) ${YEAR} The CentOS Project
Alain Reguera Delgado 954d94
#
Alain Reguera Delgado 954d94
# This program is free software; you can redistribute it and/or modify
Alain Reguera Delgado 954d94
# it under the terms of the GNU General Public License as published by
Alain Reguera Delgado 5824c8
# the Free Software Foundation; either version 2 of the License, or
Alain Reguera Delgado 5824c8
# (at your option) any later version.
Alain Reguera Delgado 954d94
#
Alain Reguera Delgado 954d94
# This program is distributed in the hope that it will be useful, but
Alain Reguera Delgado 954d94
# WITHOUT ANY WARRANTY; without even the implied warranty of
Alain Reguera Delgado 954d94
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Alain Reguera Delgado 954d94
# General Public License for more details.
Alain Reguera Delgado 954d94
#
Alain Reguera Delgado 954d94
# You should have received a copy of the GNU General Public License
Alain Reguera Delgado 954d94
# along with this program; if not, write to the Free Software
Alain Reguera Delgado 954d94
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Alain Reguera Delgado 954d94
#
Alain Reguera Delgado 5824c8
######################################################################
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
function ${MODULE_NAME}_${FUNCTION_NAME} {
Alain Reguera Delgado 954d94
    ...
Alain Reguera Delgado 954d94
}
Alain Reguera Delgado 5824c8
----------------------------------------------------------------------
Alain Reguera Delgado 954d94
+
Alain Reguera Delgado 954d94
[NOTE]
Alain Reguera Delgado 954d94
If your are planning to contribute a new module to *centos-art.sh*
Alain Reguera Delgado 954d94
script, please, consider using the layout described above for all your
Alain Reguera Delgado 954d94
function scripts, consistently.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
*$\{MODULE_NAME}.asciidoc*::
Alain Reguera Delgado 954d94
    This file contains the module's documentation source. From this
Alain Reguera Delgado 954d94
    file it is possible to produce the same documentation in other
Alain Reguera Delgado 954d94
    formats including manpage, html and pdf. Whenever you need to
Alain Reguera Delgado 954d94
    improve the module's documentation, edit this file.
Alain Reguera Delgado 954d94
*$\{MODULE_NAME}.conf*::
Alain Reguera Delgado 954d94
    This file contains the module's configuration variables. These
Alain Reguera Delgado 954d94
    variables are exported to the environment and remain there as long
Alain Reguera Delgado 954d94
    as the script execution environment is alive. Some variables are
Alain Reguera Delgado 954d94
    read-only others not.
Alain Reguera Delgado 954d94
+
Alain Reguera Delgado 954d94
The configuration file provides explanation about each environment
Alain Reguera Delgado 954d94
variable it exports. If you want to know more about what these
Alain Reguera Delgado 954d94
variables are, open this file and read the comments near each
Alain Reguera Delgado 954d94
variable.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
*$\{MODULE_NAME}.sh*::
Alain Reguera Delgado 954d94
    This is the module's initialization script. The first file
Alain Reguera Delgado 954d94
    executed when the module called from the command-line. This file
Alain Reguera Delgado 954d94
    provides access to argument parsing and controls how
Alain Reguera Delgado 954d94
    module-specific function scripts are called. This is the starting
Alain Reguera Delgado 954d94
    point for writing modules. You can write a complete module using
Alain Reguera Delgado 954d94
    this file only but, frequently, it is convenient as the module
Alain Reguera Delgado 954d94
    complexity grows to divide it in smaller pieces (function scripts)
Alain Reguera Delgado 954d94
    to improve maintainability and error findings.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
Options
Alain Reguera Delgado 954d94
-------
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
*--help*::
Alain Reguera Delgado daf412
    Print script documentation.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
*--version*::
Alain Reguera Delgado daf412
    Print script version.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 5824c8
Bugs
Alain Reguera Delgado 5824c8
----
Alain Reguera Delgado daf412
Alain Reguera Delgado daf412
The *pack* module isn't implemented yet.
Alain Reguera Delgado 5824c8
Alain Reguera Delgado 954d94
Reporting Bugs
Alain Reguera Delgado 954d94
--------------
Alain Reguera Delgado daf412
Alain Reguera Delgado 5824c8
Report bugs inside the *automation* category of *centos-artwork*
Alain Reguera Delgado 5824c8
project, at the https://centos.org.cu/bugs/[The CentOS Bugs] website.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
Author
Alain Reguera Delgado 954d94
------
Alain Reguera Delgado daf412
Alain Reguera Delgado daf412
The *centos-art.sh* script has received contribution from the
Alain Reguera Delgado daf412
following people:
Alain Reguera Delgado daf412
Alain Reguera Delgado daf412
 * Alain Reguera Delgado <mailto:al@centos.org.cu[al@centos.org.cu]>, 2009-2013
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
Copyright
Alain Reguera Delgado 954d94
---------
Alain Reguera Delgado daf412
Alain Reguera Delgado daf412
Copyright (C) 2009-2013 The CentOS Project
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
This program is free software; you can redistribute it and/or modify
Alain Reguera Delgado 954d94
it under the terms of the GNU General Public License as published by
Alain Reguera Delgado 954d94
the Free Software Foundation; either version 2 of the License, or (at
Alain Reguera Delgado 954d94
your option) any later version.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
This program is distributed in the hope that it will be useful, but
Alain Reguera Delgado 954d94
WITHOUT ANY WARRANTY; without even the implied warranty of
Alain Reguera Delgado 954d94
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Alain Reguera Delgado 954d94
General Public License for more details.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
You should have received a copy of the GNU General Public License
Alain Reguera Delgado 954d94
along with this program; if not, write to the Free Software
Alain Reguera Delgado 954d94
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Alain Reguera Delgado 954d94
Alain Reguera Delgado 954d94
// vim: set syntax=asciidoc: