Skip to content

Commit

Permalink
managed to deploy at OpenShift
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtich committed Apr 17, 2012
1 parent c7975b4 commit 42bf27d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -16,7 +16,9 @@ the following layout, inspired by the PaaS providers dotCloud and OpenShift:

dotcloud.yml - basic configuration for dotCloud (o)

libs -> app/lib - symlink for OpenShift (o)
libs -> app/lib - symlink for OpenShift (o)
perl/
index.pl - CGI script to run app.psgi for OpenShift (o)
deplist.txt -> app/deplist.txt - symlink for OpenShift (o)

.openshift/ - hooks for OpenShift (o)
Expand Down
19 changes: 13 additions & 6 deletions lib/App/Padadoy.pm
Expand Up @@ -143,6 +143,11 @@ sub create {
my $test = read_file(dist_file('App-padadoy','basic.t'));
$test =~ s/YOUR_MODULE/$module/mg;
write_file('app/t/basic.t',{no_clobber => 1},$test);

$content = read_file(dist_file('App-padadoy','index.pl.template'));
$self->msg("perl/index.pl");
make_path("perl");
write_file("perl/index.pl",{no_clobber = 1}, $content);
} else {
$self->msg('app/app.psgi');
write_file('app/app.psgi',{no_clobber => 1},
Expand Down Expand Up @@ -439,7 +444,9 @@ Your application must be managed in a git repository with following structure:
dotcloud.yml - basic configuration for dotCloud (o)
libs -> app/lib - symlink for OpenShift (o)
libs -> app/lib - symlink for OpenShift (o)
perl/
index.pl - CGI script to run app.psgi for OpenShift (o)
deplist.txt -> app/deplist.txt - symlink for OpenShift (o)
.openshift/ - hooks for OpenShift (o)
Expand Down Expand Up @@ -532,11 +539,11 @@ L<https://docloud.com>.
=head2 On OpenShift
Create an OpenShift account, install the command line client, and create a domain,
as documented at L<https://openshift.redhat.com/app/getting_started> (you may need
to C<sudo apt-get install libopenssl-ruby>, and to find and fiddle around the client
at C</var/lib/gems/1.8/bin/rhc> to actually make use of it). Actually, I have not
manage to deploy at OpenShift as seamless as at dotCloud.
Create an OpenShift account, install the command line client, and create a
domain, as documented at L<https://openshift.redhat.com/app/getting_started>
(you may need to C<sudo apt-get install libopenssl-ruby>, and to find and
fiddle around the client at C</var/lib/gems/1.8/bin/rhc> to actually make use
of it). Att your OpenShift repository as remote and merge.
=head1 SEE ALSO
Expand Down
9 changes: 9 additions & 0 deletions shares/app_padadoy/index.pl.template
@@ -0,0 +1,9 @@
#!/usr/bin/perl
# Run ../app/app.psgi as CGI script

use Plack::Loader;
use File::Basename;
my $psgi = join '/', dirname($0), '..', 'app', 'app.psgi';

my $app = Plack::Util::load_psgi($psgi);
Plack::Loader->auto->run($app);
2 changes: 1 addition & 1 deletion t/create.t
Expand Up @@ -19,7 +19,7 @@ ok( -d catdir($devdir,$_), "$_/ created" )
for qw(app data logs app/lib app/t app/lib/Foo libs);

ok( -f catdir($devdir,$_), "$_ created" )
for qw(app/app.psgi app/lib/Foo/Bar.pm dotcloud.yml);
for qw(app/app.psgi app/lib/Foo/Bar.pm dotcloud.yml perl/index.pl);

# TODO: deplist.txt is not checked

Expand Down

0 comments on commit 42bf27d

Please sign in to comment.