<commit_before>Drupdates
===========
Scripts to maintain web sites code bases, specifically Drupal sites using Drush

This script performs 4 major functions (ie phases):

1.) Builds a site's directory from a Git repository.
2.) Updates the site using drush pm-update, default to security update(s) only.
3.) Submit a deployment ticket for the updated codebase.
4.) Report on the site(s) Drupdates attempted to update.

Installation
============
easy_install https://github.com/jalama/drupdates/tarball/master

note: you may need sudo to run easy_install

Execution
============

$ drupdates

note: Any setting can be passed as an option from the CLI, so if you want
Drupdates to use /opt/ as the working directory in lieu of /var/www/

$ drupdates --workingDir=/opt/

Requirements
============
Drush (preferably Drush 7)
Git 1.7+

Assumptions
===========

- Only tested on POSIX boxes with Python 2.6 and 2.7, sorry no Windows yet.

- Python 3+ support is forthcoming.

- Drupdates is not intened for production systems, it is built assuming it
will only be run on local development machines.  Drupdates will need to store
system user names and passwords in the $HOME/.drupdates directory.

- The entire script depends on the use of Drush site aliases named after the
folders the sites are written to (prefixed with "drupdates".  Drupdates assumes
any back-up files follow the pattern of being named after that same
folder/<site alias>.
  - example: site folder is /var/www/drupal the back-up file is drupal.sql and
  the Drush alias will be drupdates.drupal

- Lack of a back-up will not stop Drupdates from updating the Drupal codebase.

- Any Make file used to build a site will be named the same as the site folder.

- By default the script tries to build the sites in /var/www/

Settings
===========

To make this script meet your needs you will need to customize the settings,
loaded from YAML files.  As of version 1.0 there is no installer so the settings
are changed and updated by either using a YAML file or passing options at
runtime.

At see http://pyyaml.org/wiki/PyYAMLDocumentation for YAML basics.

Here's how it works:

Settings are built from either YAML files or options passed when run on CLI.
- Settings are loaded in this order:
  - Core settings file, ie drupdates/settings/default.yaml
  - Plugin settings files, ie <plugin dir>/settings/default.yaml
  - Local settings file in $HOME/.drupdates, ie $HOME/.drupdates/settings.py
  - Options passed at runtime, ie $python -m drupdates --workingDir=/opt/
  - Prompts to end user, only if required and not value found above

Settings loaded later take precident over the same setting loaded earlier,
ie if it's set at runtime it will overwrite anything set in the Core settings
or local settings files.

The Core settings file is <module dir>/drupdates/settings/default.yaml or
https://github.com/jalama/drupdates/blob/master/drupdates/settings/default.yaml.
Additionally, each plugin ships with it's own default.yaml file in its
respective settings directory.

Settings Format:

Each setting in the YAML file needs to look like this or it will be assumed
to be blank (ie "").  <notes on what each line means for clarities sake>

setting:  <the name of the setting>
  value: <required, value of the setting*>

Optionally each setting can have other attributes (@see Settings.model()):

setting:
  value:
  prompt: <optional, Prompt presented at runtime if setting is null and required>
  format: <optional, What is the format, supported values: string (default), list, dict>
  required: <optional, Is the setting required**>
  requires: <optional, does this setting require another setting>

* Surround with '' if value contains special cahracters.  For list of YAML
special characters @see http://www.yaml.org/refcard.html.
** If setting is required and is empty, the end user will be asked for a value.
<commit_msg>README indentation issues<commit_after>Drupdates
===========
Scripts to maintain web sites code bases, specifically Drupal sites using Drush

This script performs 4 major functions (ie phases):

1.) Builds a site's directory from a Git repository.
2.) Updates the site using drush pm-update, default to security update(s) only.
3.) Submit a deployment ticket for the updated codebase.
4.) Report on the site(s) Drupdates attempted to update.

Installation
============
easy_install https://github.com/jalama/drupdates/tarball/master

note: you may need sudo to run easy_install

Execution
============

$ drupdates

note: Any setting can be passed as an option from the CLI, so if you want
Drupdates to use /opt/ as the working directory in lieu of /var/www/

$ drupdates --workingDir=/opt/

Requirements
============
Drush (preferably Drush 7)
Git 1.7+

Assumptions
===========

- Only tested on POSIX boxes with Python 2.6 and 2.7, sorry no Windows yet.

- Python 3+ support is forthcoming.

- Drupdates is not intended for production systems, it is built assuming it
will only be run on local development machines.  Drupdates will need to store
system user names and passwords in the $HOME/.drupdates directory.

- The entire script depends on the use of Drush site aliases named after the
folders the sites are written to (prefixed with "drupdates".  Drupdates assumes
any back-up files follow the pattern of being named after that same
folder/<site alias>.
  - example: site folder is /var/www/drupal the back-up file is drupal.sql and
  the Drush alias will be drupdates.drupal

- Lack of a back-up will not stop Drupdates from updating the Drupal codebase.

- Any Make file used to build a site will be named the same as the site folder.

- By default the script tries to build the sites in /var/www/

Settings
===========

To make this script meet your needs you will need to customize the settings,
loaded from YAML files.  As of version 1.0 there is no installer so the settings
are changed and updated by either using a YAML file or passing options at
runtime.

At see http://pyyaml.org/wiki/PyYAMLDocumentation for YAML basics.

Here's how it works:

Settings are built from either YAML files or options passed when run on CLI.
- Settings are loaded in this order:
  - Core settings file, ie drupdates/settings/default.yaml
  - Plugin settings files, ie *plugin dir*/settings/default.yaml
  - Local settings file in $HOME/.drupdates, ie $HOME/.drupdates/settings.py
  - Options passed at runtime, ie $python -m drupdates --workingDir=/opt/
  - Prompts to end user, only if required and not value found above

Settings loaded later take precident over the same setting loaded earlier,
ie if it's set at runtime it will overwrite anything set in the Core settings
or local settings files.

The Core settings file is /drupdates/settings/default.yaml or
https://github.com/jalama/drupdates/blob/master/drupdates/settings/default.yaml.
Additionally, each plugin ships with it's own default.yaml file in its
respective settings directory.

Settings Format:

Each setting in the YAML file needs to look like this or it will be assumed
to be blank (ie "").  *notes on what each line means for clarities sake*

setting:  *the name of the setting*<br>
  value: *required, value of the setting1*<br>

Optionally each setting can have other attributes (@see Settings.model()):

setting:
  value:<br>
  prompt: *optional, Prompt presented at runtime if setting is null and required*<br>
  format: *optional, What is the format, supported values: string (default), list, dict*<br>
  required: *optional, Is the setting required2<br>
  requires: *optional, does this setting require another setting*<br>

1 Surround with '' if value contains special cahracters.  For list of YAML
special characters @see http://www.yaml.org/refcard.html.
2 If setting is required and is empty, the end user will be asked for a value.

{'fraction_non_alphanumeric': 0.07882594206613688, 'fraction_numerical': 0.004357856959753909, 'mean_word_length': 4.1268068331143235, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 4, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2691700', 'n_tokens_mistral': 2190, 'n_tokens_neox': 2121, 'n_words': 1105}