Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
App::Sqitch::Target(3)User Contributed Perl DocumentatioApp::Sqitch::Target(3)

Name
       App::Sqitch::Target - Sqitch deployment target

Synopsis
	 my $plan = App::Sqitch::Target->new(
	     sqitch => $sqitch,
	     name   => 'development',
	 );
	 $target->engine->deploy;

Description
       App::Sqitch::Target provides collects, in one place, the	engine,	plan,
       and file	locations required to carry out	Sqitch commands. All commands
       should instantiate a target to work with	the plan or database.

Interface
   Constructors
       "new"

	 my $target = App::Sqitch::Target->new(	sqitch => $sqitch );

       Instantiates and	returns	an App::Sqitch::Target object. The most
       important parameters are	"sqitch", "name", and "uri". The constructor
       tries really hard to figure out the proper name and URI during
       construction. If	the "uri" parameter is passed, this is straight-
       forward:	if no "name" is	passed,	"name" will be set to the stringified
       format of the URI (minus	the password, if present).

       Otherwise, when no URI is passed, the name and URI are determined by
       taking the following steps:

       o   If there is no name,	get the	engine key from	"--engine" or the
	   "core.engine" configuration option. If no key can be	determined, an
	   exception will be thrown.

       o   Use the key to look up the target name in the
	   "engine.$engine.target" configuration option. If none is found, use
	   "db:$key:".

       o   If the name contains	a colon	(":"), assume it is also the value for
	   the URI.

       o   Otherwise, it should	be the name of a configured target, so look
	   for a URI in	the "target.$name.uri" configuration option.

       As a general rule, then,	pass either a target name or URI string	in the
       "name" parameter, and Sqitch will do its	best to	find all the relevant
       target information. And if there	is no name or URI, it will try to
       construct a reasonable default from the command-line options or engine
       configuration.

       "all_targets"

       Returns a list of all the targets defined by the	local Sqitch
       configuration file. Done	by examining the configuration object to find
       all defined targets and engines,	as well	as the default "core" target.
       Duplicates are removed and the list returned. This method takes two
       parameters:

       o   "sqitch"

	   An App::Sqitch object. Required.

       o   "config"

	   An App::Sqitch::Config object. If not passed, the object stored in
	   the Sqitch object's "config"	attribute will be used.

   Accessors
       "sqitch"

	 my $sqitch = $target->sqitch;

       Returns the App::Sqitch object that instantiated	the target.

       "name"

       "target"

	 my $name = $target->name;
	 $name = $target->target;

       The name	of the target. If there	was no name specified, the URI will be
       used (minus the password, if there is one).

       "uri"

	 my $uri = $target->uri;

       The URI::db object encapsulating	the database connection	information.

       "username"

	 my $username =	$target->username;

       Returns the target username, if any. The	username is looked up from the
       URI.

       "password"

	 my $password =	$target->password;

       Returns the target password, if any. The	password is looked up from the
       URI or the $SQITCH_PASSWORD environment variable.

       "engine"

	 my $engine = $target->engine;

       A App::Sqitch::Engine object to use for database	interactions with the
       target.

       "registry"

	 my $registry =	$target->registry;

       The name	of the registry	used by	the database. The value	comes from one
       of these	options, searched in this order:

       o   "--registry"

       o   "target.$name.registry"

       o   "engine.$engine.registry"

       o   "core.registry"

       o   Engine-specific default

       "client"

	 my $client = $target->client;

       Path to the engine command-line client. The value comes from one	of
       these options, searched in this order:

       o   "--client"

       o   "target.$name.client"

       o   "engine.$engine.client"

       o   "core.client"

       o   Engine-and-OS-specific default

       "top_dir"

	 my $top_dir = $target->top_dir;

       The path	to the top directory of	the project. This directory generally
       contains	the plan file and subdirectories for deploy, revert, and
       verify scripts. The value comes from one	of these options, searched in
       this order:

       o   "--top-dir"

       o   "target.$name.top_dir"

       o   "engine.$engine.top_dir"

       o   "core.top_dir"

       o   .

       "plan_file"

	 my $plan_file = $target->plan_file;

       The path	to the plan file. The value comes from one of these options,
       searched	in this	order:

       o   "--plan-file"

       o   "target.$name.plan_file"

       o   "engine.$engine.plan_file"

       o   "core.plan_file"

       o   $top_dir/sqitch.plan

       "deploy_dir"

	 my $deploy_dir	= $target->deploy_dir;

       The path	to the deploy directory	of the project.	This directory
       contains	all of the deploy scripts referenced by	changes	in the
       "plan_file". The	value comes from one of	these options, searched	in
       this order:

       o   "--dir deploy_dir=$deploy_dir"

       o   "target.$name.deploy_dir"

       o   "engine.$engine.deploy_dir"

       o   "core.deploy_dir"

       o   "$top_dir/deploy"

       "revert_dir"

	 my $revert_dir	= $target->revert_dir;

       The path	to the revert directory	of the project.	This directory
       contains	all of the revert scripts referenced by	changes	the
       "plan_file". The	value comes from one of	these options, searched	in
       this order:

       o   "--dir revert_dir=$revert_dir"

       o   "target.$name.revert_dir"

       o   "engine.$engine.revert_dir"

       o   "core.revert_dir"

       o   "$top_dir/revert"

       "verify_dir"

	 my $verify_dir	= $target->verify_dir;

       The path	to the verify directory	of the project.	This directory
       contains	all of the verify scripts referenced by	changes	in the
       "plan_file". The	value comes from one of	these options, searched	in
       this order:

       o   "--dir verify_dir=$verify_dir"

       o   "target.$name.verify_dir"

       o   "engine.$engine.verify_dir"

       o   "core.verify_dir"

       o   "$top_dir/verify"

       "reworked_dir"

	 my $reworked_dir = $target->reworked_dir;

       The path	to the reworked	directory of the project. This directory
       contains	subdirectories for reworked deploy, revert, and	verify
       scripts.	The value comes	from one of these options, searched in this
       order:

       o   "--dir reworked_dir=$reworked_dir"

       o   "target.$name.reworked_dir"

       o   "engine.$engine.reworked_dir"

       o   "core.reworked_dir"

       o   $top_dir

       "reworked_deploy_dir"

	 my $reworked_deploy_dir = $target->reworked_deploy_dir;

       The path	to the reworked	deploy directory of the	project. This
       directory contains all of the reworked deploy scripts referenced	by
       changes in the "plan_file". The value comes from	one of these options,
       searched	in this	order:

       o   "--dir reworked_deploy_dir=$reworked_deploy_dir"

       o   "target.$name.reworked_deploy_dir"

       o   "engine.$engine.reworked_deploy_dir"

       o   "core.reworked_deploy_dir"

       o   "$reworked_dir/reworked_deploy"

       "reworked_revert_dir"

	 my $reworked_revert_dir = $target->reworked_revert_dir;

       The path	to the reworked	revert directory of the	project. This
       directory contains all of the reworked revert scripts referenced	by
       changes the "plan_file".	The value comes	from one of these options,
       searched	in this	order:

       o   "--dir reworked_revert_dir=$reworked_revert_dir"

       o   "target.$name.reworked_revert_dir"

       o   "engine.$engine.reworked_revert_dir"

       o   "core.reworked_revert_dir"

       o   "$reworked_dir/reworked_revert"

       "reworked_verify_dir"

	 my $reworked_verify_dir = $target->reworked_verify_dir;

       The path	to the reworked	verify directory of the	project. This
       directory contains all of the reworked verify scripts referenced	by
       changes in the "plan_file". The value comes from	one of these options,
       searched	in this	order:

       o   "--dir reworked_verify_dir=$reworked_verify_dir"

       o   "target.$name.reworked_verify_dir"

       o   "engine.$engine.reworked_verify_dir"

       o   "core.reworked_verify_dir"

       o   "$reworked_dir/reworked_verify"

       "extension"

	 my $extension = $target->extension;

       The file	name extension to append to change names to create script file
       names.  The value comes from one	of these options, searched in this
       order:

       o   "--extension"

       o   "target.$name.extension"

       o   "engine.$engine.extension"

       o   "core.extension"

       o   "sql"

       "engine_key"

	 my $key = $target->engine_key;

       The key defining	which engine to	use. This value	defines	the class
       loaded by "engine". Convenience method for
       "$target->uri->canonical_engine".

       "dsn"

	 my $dsn = $target->dsn;

       The DSN to use when connecting to the target via	the DBI. Convenience
       method for "$target->uri->dbi_dsn".

       "username"

	 my $username =	$target->username;

       The username to use when	connecting to the target via the DBI.
       Convenience method for "$target->uri->user".

       "password"

	 my $password =	$target->password;

       The password to use when	connecting to the target via the DBI.
       Convenience method for "$target->uri->password".

See Also
       sqitch
	   The Sqitch command-line client.

Author
       David E.	Wheeler	<david@justatheory.com>

License
       Copyright (c) 2012-2015 iovation	Inc.

       Permission is hereby granted, free of charge, to	any person obtaining a
       copy of this software and associated documentation files	(the
       "Software"), to deal in the Software without restriction, including
       without limitation the rights to	use, copy, modify, merge, publish,
       distribute, sublicense, and/or sell copies of the Software, and to
       permit persons to whom the Software is furnished	to do so, subject to
       the following conditions:

       The above copyright notice and this permission notice shall be included
       in all copies or	substantial portions of	the Software.

       THE SOFTWARE IS PROVIDED	"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
       OR IMPLIED, INCLUDING BUT NOT LIMITED TO	THE WARRANTIES OF
       MERCHANTABILITY,	FITNESS	FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
       IN NO EVENT SHALL THE AUTHORS OR	COPYRIGHT HOLDERS BE LIABLE FOR	ANY
       CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN	ACTION OF CONTRACT,
       TORT OR OTHERWISE, ARISING FROM,	OUT OF OR IN CONNECTION	WITH THE
       SOFTWARE	OR THE USE OR OTHER DEALINGS IN	THE SOFTWARE.

perl v5.32.0			  2020-08-29		App::Sqitch::Target(3)

Name | Synopsis | Description | Interface | See Also | Author | License

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=App::Sqitch::Target&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help