orepan2-s3
This script is used to add distributions to your own DarkPAN repository housed on Amazon's S3 storage. It leverages OrePAN2 to create and maintain your own DarkPAN repository. You can read more about setting up a DarkPAN on Amazon using S3 + Cloudfront here.
orepan2-s3 Options Command
Script for maintaining a DarkPAN mirror using S3 + CloudFront
index.html from the mirror's manifest file.02packages.details.text.gz).-h, --help Display this help message
-c, --config-file Name of the configuration file (default: ~/.orepan2-s3.json)
-o, --output Name of the output file
-p, --profile Name of a profile inside the config file
-t, --template Name of a template that will be used as the index.html page
-d, --distribution Path to distribution tarball
-u, --upload Upload files after processing (for create-index, create-docs)
-U, --url Cloudfront URL
The configuration file for orepan2-s3 is a JSON file that can
contain multiple profiles (or none). The format should look something
like this:
{
"tbc" : {
"AWS": {
"profile" : "prod",
"region" : "us-east-1",
"bucket" : "tbc-cpan-mirror",
"prefix" : "orepan2"
},
"CloudFront" : {
"DistributionId" : "E2ABCDEFGHIJK"
}
},
"default" : {
"index" : {
"template" : "/path/to/template",
"files": {
"src" : "dest"
}
},
"AWS": {
"profile" : "prod",
"region" : "us-east-1",
"bucket" : "cpan.openbedrock.net",
"prefix" : "orepan2"
},
"CloudFront" : {
"DistributionId" : "E2JKLMNOPQRXYZ",
"InvalidationPaths" : [],
"url" : "https://cpan.openbedrock.net/orepan2"
}
}
}
Each profile can contain up to 3 sections (AWS, CloudFront, index). If you only have one profile you don't need place it in a 'default' section.
index
This section allows you to create custom template for the DarkPAN home page.
template
The name of a template file that will be parsed and uploaded as
/index.html. If you do not provide a template file a default
template. The default template is a Template::Toolkit style
template. To see the default template use the dump-template command
to the orepan2-index script.
orepan2-index dump-template
The templating process is provided with these variables:
utils
A blessed reference to an object with one method (module_name) that
returns a verison of the module_name suitable for use as unique id.
repo
A hash of key value pairs where the key is the name of a DarkPAN distribution and value is an array or arrays. Each array is of the form:
[0] => Perl module name
[1] => Module version
localtime
The current time and date as a string.
files
A hash of source/destination pairs that specify additional files to upload.
Example:
"files" {
"/home/rlauer/git/some-project/foo.css" : "/css/foo.css",
"/home/rlauer/git/some-project/foo.js" : "/javascript/foo.js"
}
AWS
profile
The IAM profile where the bucket is provisioned.
region
AWS region. Default: us-east-1
bucket
S3 bucket name
prefix
The prefix where the CPAN distribution files will be stored. Default: orepan2.
DistributionId
CloudFront distribution id
InvalidationPaths
An array of additional paths to invalidate when adding new distributions.
Note: There is no additional charge for adding additional paths. Each invalidation batch is considered as one billing unit by AWS. However, keep in mind you get 1000 invalidation paths for free each month. Thereafter each path costs $0.005 per path.
Rob Lauer - rlauer6@comcast.net
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.