Class: Ansible::Ruby::Modules::Deploy_helper

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/web_infrastructure/deploy_helper.rb

Overview

The Deploy Helper manages some of the steps common in deploying software. It creates a folder structure, manages a symlink for the current release and cleans up old releases. Running it with the C(state=query) or C(state=present) will return the C(deploy_helper) fact. C(project_path), whatever you set in the path parameter, C(current_path), the path to the symlink that points to the active release, C(releases_path), the path to the folder to keep releases in, C(shared_path), the path to the folder to keep shared resources in, C(unfinished_filename), the file to check for to recognize unfinished builds, C(previous_release), the release the ‘current’ symlink is pointing to, C(previous_release_path), the full path to the ‘current’ symlink target, C(new_release), either the ‘release’ parameter or a generated timestamp, C(new_release_path), the path to the new release folder (not created by the module).

Instance Method Summary collapse

Methods inherited from Base

#ansible_name, #to_h

Methods inherited from Ansible::Ruby::Models::Base

attr_option, attr_options, attribute, fix_inclusion, #initialize, remove_existing_validations, #to_h, validates

Constructor Details

This class inherits a constructor from Ansible::Ruby::Models::Base

Instance Method Details

#clean:yes, ...

Returns Whether to run the clean procedure in case of C(state=finalize).

Returns:

  • (:yes, :no, nil)

    Whether to run the clean procedure in case of C(state=finalize).



41
# File 'lib/ansible/ruby/modules/generated/web_infrastructure/deploy_helper.rb', line 41

attribute :clean

#current_pathString?

Returns the name of the symlink that is created when the deploy is finalized. Used in C(finalize) and C(clean). Returned in the C(deploy_helper.current_path) fact.

Returns:

  • (String, nil)

    the name of the symlink that is created when the deploy is finalized. Used in C(finalize) and C(clean). Returned in the C(deploy_helper.current_path) fact.



33
# File 'lib/ansible/ruby/modules/generated/web_infrastructure/deploy_helper.rb', line 33

attribute :current_path

#keep_releasesInteger?

Returns the number of old releases to keep when cleaning. Used in C(finalize) and C(clean). Any unfinished builds will be deleted first, so only correct releases will count. The current version will not count.

Returns:

  • (Integer, nil)

    the number of old releases to keep when cleaning. Used in C(finalize) and C(clean). Any unfinished builds will be deleted first, so only correct releases will count. The current version will not count.



45
# File 'lib/ansible/ruby/modules/generated/web_infrastructure/deploy_helper.rb', line 45

attribute :keep_releases

#pathString

Returns the root path of the project. Alias I(dest). Returned in the C(deploy_helper.project_path) fact.

Returns:

  • (String)

    the root path of the project. Alias I(dest). Returned in the C(deploy_helper.project_path) fact.



13
# File 'lib/ansible/ruby/modules/generated/web_infrastructure/deploy_helper.rb', line 13

attribute :path

#releaseString?

Returns the release version that is being deployed. Defaults to a timestamp format %Y%m%d%H%M%S (i.e. ‘20141119223359’). This parameter is optional during C(state=present), but needs to be set explicitly for C(state=finalize). You can use the generated fact C(release=deploy_helper.new_release }).

Returns:

  • (String, nil)

    the release version that is being deployed. Defaults to a timestamp format %Y%m%d%H%M%S (i.e. ‘20141119223359’). This parameter is optional during C(state=present), but needs to be set explicitly for C(state=finalize). You can use the generated fact C(release=deploy_helper.new_release }).



21
# File 'lib/ansible/ruby/modules/generated/web_infrastructure/deploy_helper.rb', line 21

attribute :release

#releases_pathString?

Returns the name of the folder that will hold the releases. This can be relative to C(path) or absolute. Returned in the C(deploy_helper.releases_path) fact.

Returns:

  • (String, nil)

    the name of the folder that will hold the releases. This can be relative to C(path) or absolute. Returned in the C(deploy_helper.releases_path) fact.



25
# File 'lib/ansible/ruby/modules/generated/web_infrastructure/deploy_helper.rb', line 25

attribute :releases_path

#shared_pathString?

Returns the name of the folder that will hold the shared resources. This can be relative to C(path) or absolute. If this is set to an empty string, no shared folder will be created. Returned in the C(deploy_helper.shared_path) fact.

Returns:

  • (String, nil)

    the name of the folder that will hold the shared resources. This can be relative to C(path) or absolute. If this is set to an empty string, no shared folder will be created. Returned in the C(deploy_helper.shared_path) fact.



29
# File 'lib/ansible/ruby/modules/generated/web_infrastructure/deploy_helper.rb', line 29

attribute :shared_path

#state:present, ...

Returns the state of the project. C(query) will only gather facts, C(present) will create the project I(root) folder, and in it the I(releases) and I(shared) folders, C(finalize) will remove the unfinished_filename file, create a symlink to the newly deployed release and optionally clean old releases, C(clean) will remove failed & old releases, C(absent) will remove the project folder (synonymous to the M(file) module with C(state=absent)).

Returns:

  • (:present, :finalize, :absent, :clean, :query, nil)

    the state of the project. C(query) will only gather facts, C(present) will create the project I(root) folder, and in it the I(releases) and I(shared) folders, C(finalize) will remove the unfinished_filename file, create a symlink to the newly deployed release and optionally clean old releases, C(clean) will remove failed & old releases, C(absent) will remove the project folder (synonymous to the M(file) module with C(state=absent))



17
# File 'lib/ansible/ruby/modules/generated/web_infrastructure/deploy_helper.rb', line 17

attribute :state

#unfinished_filenameString?

Returns the name of the file that indicates a deploy has not finished. All folders in the releases_path that contain this file will be deleted on C(state=finalize) with clean=True, or C(state=clean). This file is automatically deleted from the I(new_release_path) during C(state=finalize).

Returns:

  • (String, nil)

    the name of the file that indicates a deploy has not finished. All folders in the releases_path that contain this file will be deleted on C(state=finalize) with clean=True, or C(state=clean). This file is automatically deleted from the I(new_release_path) during C(state=finalize).



37
# File 'lib/ansible/ruby/modules/generated/web_infrastructure/deploy_helper.rb', line 37

attribute :unfinished_filename