This part of the documentation covers the application programming interface of Parcel.
The majority of work done by Parcel is using the Deployment object.
The core Deployment object. All Fabric tasks built with Parcel will probably use this an instance of this class.
Copies data in file on remotepath (relative to final root)
Add lines to the postinst file
Add lines to the postrm file
Add lines to the preinst file
Add lines to the prerm file
Add a local file to the root package path. If remote path ends in /, the filename is copied into that directory. If the remote path doesn’t end in /, it represents the final filename.
The name of the resulting package.
The architecture of the build host. This should be a Distro object.
Location of files during build on build host. Default is user’s home directory. If path is relative, it’s relative to the remote user’s home directory. If the path is absolute, it’s used as is.
A list of packages that need to be installed to build the software.
Takes the whole app including the virtualenv, packages it using fpm and downloads it to the local host. The version of the package is the build number - which is just the latest package version in our Ubuntu repositories plus one.
The directory that will be used as the base level directory.
Creates the necessary directories on the build server, checks out the desired branch (None means current), creates a virtualenv and populates it with dependencies from requirements.txt.
Parameters: | requirements – The name of the requirements.txt file relative to the path setting used in the constructor. |
---|
A list of packages that must be installed to run the resulting package.
Take a template postinst script and format it with appname and postinst_lines If you call this function you must supply a template string that includes {app_name} and {lines}.
Take a template postrm script and format it with appname and postrm_lines If you call this function you must supply a template string that includes {app_name} and {lines}.
Take a template preinst script and format it with appname and preinst_lines If you call this function you must supply a template string that includes {app_name} and {lines}.
Take a template prerm script and format it with appname and prerm_lines If you call this function you must supply a template string that includes {app_name} and {lines}.
Access your Mercurial revision control information with the Hg objects.
An interface to Mercurial source repositories.
A property that is the present checked out branch
hg clone a repo or path to the present repo location. The Hg path and object this is called on should be clean. In other words you should call clone() immedately after construction of the Hg object and make sure that the Hg object is constructed on an empty path.
eg.
hg = Hg(“build/clone”) hg.clone(“hg+ssh://bitbucet.org/project”)
Create a vesrion tag composed of the latest tag, the tag distance, and the short hash. For example:
0.5.1-23-d63d252639de
composed of the tag 0.5.1, from which we are 23 commits forwards of, with a latest changeset of hash d63d252639de
A property that is the latest log entry. Returns a dictionary with the following keys: changeset: The hash number of the lastest changeset. date: The date and time of the latest changeset. user: Who committed the change summary: The commit message tag: if this commit is tagged, this is the tag.
Returns all the log entries as a list of dictionaries. Each dictionary is of the format returned by log.
The base path of the Mercurial repository.
Issue a hg pull on the repository
Issue a hg update on the repository
Access your Git revision control information with the Git objects.
An abstraction of Git Repositories.
Return which branch the repository is checked out on.
Use git checkout to bring the repository to a particular point
git clone a repo or path to the present repo location. The Git path and object this is called on should be clean. In other words you should call clone() immedately after construction of the Git object and make sure that the Git object is constructed on an empty path.
eg.
git = Git(“build/clone”) git.clone(“git://github.org/project”)
Use git describe to create a version tag describing the repository at this point.
Return all the git logs in a list
Execute a git pull in the repository
Code specific to different distributions can be found in the Distro object.
The base class for Distro classes. If use_sudo is true, then super user commands will be run using fabric’s sudo call. If sudo is false, super user access is gained by getting fabric to connect as root user.
This method should install the build dependencies on the remote box.
Check the remote build host to see if the relevant software to build packages is installed
Installs package on the host using apt-get install bypassing authentication. This method should be used for testing package installation before using push_to_repo.
Make a directory on the remote
Push all the files in pathlist into dst directory on remote.
This method should set up a remote box for parcel package building. It should install fpm.
Method to perform a remote task as a super user. Takes same arguments as fabric.api.run or fabric.api.sudo. Can be overridden to provide your own super user execution hook.
This method should update the packages on the remote box.
Look at the distro’s packaging system for the package and return a version
Code specific to the Debian distribution can be found in the Debian object.
Runs architecture specific packaging tasks
Check the remote build host to see if the relevant software to build packages is installed
Installs package on the host using apt-get install bypassing authentication. This method should be used for testing package installation before using push_to_repo.
Make a directory on the remote
Push all the files in pathlist into dst directory on remote.
this method sets up a remote debian box for parcel package building. Installs fpm, easyinstall and some libraries.
Method to perform a remote task as a super user. Takes same arguments as fabric.api.run or fabric.api.sudo. Can be overridden to provide your own super user execution hook.
Look at the debian apt package system for a package with this name and return its version. Return None if there is no such package.
Code specific to the Ubuntu distribution can be found in the Ubuntu object.
Runs architecture specific packaging tasks
Check the remote build host to see if the relevant software to build packages is installed
Installs package on the host using apt-get install bypassing authentication. This method should be used for testing package installation before using push_to_repo.
Make a directory on the remote
Push all the files in pathlist into dst directory on remote.
this method sets up a remote ubuntu box for parcel package building. Installs fpm and also rubygems if not present.
Method to perform a remote task as a super user. Takes same arguments as fabric.api.run or fabric.api.sudo. Can be overridden to provide your own super user execution hook.
Look at the debian apt package system for a package with this name and return its version. Return None if there is no such package.
Code specific to the CentOS distribution can be found in the Centos object.
Runs architecture specific packaging tasks
Check the remote build host to see if the relevant software to build packages is installed
Installs package on the host using apt-get install bypassing authentication. This method should be used for testing package installation before using push_to_repo.
Make a directory on the remote
Push all the files in pathlist into dst directory on remote.
this method sets up a remote centos box for parcel package building. Installs fpm and also rubygems if not present.
Method to perform a remote task as a super user. Takes same arguments as fabric.api.run or fabric.api.sudo. Can be overridden to provide your own super user execution hook.
Look at the debian apt package system for a package with this name and return its version. Return None if there is no such package.