https://github.com/rexops/rex-project
A class to manage deployment projects
https://github.com/rexops/rex-project
Last synced: 12 months ago
JSON representation
A class to manage deployment projects
- Host: GitHub
- URL: https://github.com/rexops/rex-project
- Owner: RexOps
- Created: 2015-10-29T20:11:20.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-15T12:03:11.000Z (over 9 years ago)
- Last Synced: 2025-01-05T06:29:36.428Z (about 1 year ago)
- Language: Perl
- Size: 25.4 KB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Project
Project is the main class for application deployments. It encapsulates all settings and applications a project have.
Usually you have your own project class extending this base class.
## Architecture
```
----
| DB |
/ ----
/
----------/ -------------
| Project |-------| Application |
---------- -------------
/\
/ \
/ \
----------- -----------
| instance1 | | instance2 |
----------- -----------
| |
--------------- ---------------
| configuration | | configuration |
--------------- ---------------
```
## Extending Project class
This class uses Moose for class construction so extending this class is easy.
```perl
package My::Project {
use Moose;
extends 'Project';
}
```
### Overwriting Methods
Most time you want to overwrite the attribute that holds the configuration variables and the base path for you services.
#### srv_root_path
```perl
has srv_root_path => (
is => 'ro',
default => sub {
return "/srv";
}
);
```
#### configuration_template_variables
```perl
has configuration_template_variables => (
is => 'ro',
default => sub {
my $my_custom_variables = {
foo => "bar",
baz => "bam",
};
return $my_custom_variables;
},
);
```