Please is a set of commands useful for maintaining software projects.
For example, please can be used manage change to databases. Let's say you need to add a column to a table in your Staging database. First, you would create a .sql script that contained the alter table statement and save it to a directory maybe named .\migrations. Next, you would run please add timestamp in .\migrations which prepends a timestamp to the name of the .sql file. Finally, you run please run sql in .\migrations on Staging to "migrate" the Staging database and please will run any .sql scripts that have not been ran before in the Staging database (in this case your alter table statement). Please automatically keeps track of which .sql scripts have ran in the database based on the timestamp values. Please also supports running .py files and/or a mix of .sql and .py files as migrations. This gives you the full power of python as a migration which could be used to do something like run a set of arcpy commands to automate an ArcGIS Server task.
However, you don't typically run please commands directly from the command line. You probably setup scripts (maybe rake tasks) that call please and other necessary commands that can be ran from a continuous integration (CI) server. The plain English style of the please commands ensures your CI scripts are easy to read.
The word or words that immediately follow please designate the command to run, and the command is followed by options. There are currently five commands - bump, run sql, run py, run all, and add timestamp.
Command for bumping version numbers in files (usually for releasing a NuGet package). Bump can bump the major, minor, or patch versions in AssemblyInfo.cs files and .nuspec files, as well as .nupkg references (.nupkg files contain version numbers in their file name) in text files (e.g. scripts).
please bump major version in .\app\TheApp\Properties\AssemblyInfo.csplease bump minor version in .\release\template\TheApp.nuspecplease bump patch version in .\release\staging.bat
major versionwill cause the major version to be bumpedminor versionwill cause the minor version to be bumpedpatch versionwill cause the patch version to be bumpedin .\filespecifies the file containing the version reference
Command for running a single .sql file or a batch of .sql files in a directory on a given database.
please run sql file .\script.sql on DATABASEplease run sql in .\directory on DATABASEplease run sql with versioning in .\directory on DATABASEplease run sql include .\whitelist.txt in .\directory on DATABASE
file .\script.sqlspecifies an individual sql file to runin .\directoryspecifies the directory containing the .sql fileson DATABASEspecifies the name of the database connectionString in please.exe.configwith versioninguses the version number prepended to the .sql file (e.g. 20130901000000_create-table.sql) to ensure the .sql file is only ran once on the given databaseinclude .\whitelist.txtspecifies a file containing the list of .sql files to run if found in the given .\directory
Command for running a single .py file or a batch of .py files in a directory.
please run py file .\script.pyplease run py with versioning in .\directory on DATABASEplease run py include .\whitelist.txt in .\directory on DATABASE
file .\script.pyspecifies an individual sql file to runin .\directoryspecifies the directory containing the .py fileson DATABASEspecifies the name of the database connectionString in please.exe.config (only applicable if combined withwith versioning)with versioninguses the version number prepended to the .py file (e.g. 20130901000000_create-table.py) to ensure the .py file is only ran onceinclude .\whitelist.txtspecifies a file containing the list of .py files to run if found in the given .\directory
Command for running a batch of .sql and/or .py files in a directory.
please run all in .\directory on DATABASEplease run all with versioning in .\directory on DATABASEplease run all include .\whitelist.txt in .\directory on DATABASE
in .\directoryspecifies the directory containing the .sql and/or .py fileson DATABASEspecifies the name of the database connectionString in please.exe.config (only applicable to .sql files or if combined withwith versioning)with versioninguses the version number prepended to the .sql and/or .py file (e.g. 20130901000000_create-table.sql) to ensure the .sql and/or .py file is only ran onceinclude .\whitelist.txtspecifies a file containing the list of .sql and/or .py files to run if found in the given .\directory
Command for adding a timestamp to all files in a directory that don't already have them.
please add timestamp in .\directory
in .\directoryspecifies the directory containing the files
See Contributing.