Skip to content

Commit

Permalink
add deploy configuration and script
Browse files Browse the repository at this point in the history
This is a temporary solution until Statocles is rewritten to have deploy
commands, and then we should be able to configure and use those instead.
  • Loading branch information
preaction committed Nov 24, 2018
1 parent ffea76f commit 8b62231
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions eg/doc-site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deploy/
7 changes: 7 additions & 0 deletions eg/doc-site/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@ command](http://metacpan.org/pod/Mojolicious::Command::Export):

$ carton exec ./myapp.pl export

## Deploying the Site

The `deploy.sh` script deploys the site to <http://preaction.me/yancy/>
(if you have an SSH account to preaction.me, of course). It uses the
Mojolicious `--mode|-m` option to pick the `myapp.preaction.conf`
configuration file.

9 changes: 9 additions & 0 deletions eg/doc-site/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

root=$(dirname $0)
deploy=$root/deploy

if [ ! -d $deploy ]; then
mkdir $deploy
fi
perl $root/myapp.pl export -m preaction --to $deploy
rsync -rvzm --delete $deploy/. preaction.me:/var/www/www.preaction.me/yancy/.
2 changes: 2 additions & 0 deletions eg/doc-site/myapp.pl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
};
app->db->auto_migrate(1)->migrations->from_data( 'main' );

plugin Config => { default => {} };

plugin 'PODViewer', {
default_module => 'Yancy',
allow_modules => [qw( Yancy Mojolicious::Plugin::Yancy )],
Expand Down
6 changes: 6 additions & 0 deletions eg/doc-site/myapp.preaction.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
export => {
paths => [ '/' ],
base => '/yancy',
},
}

0 comments on commit 8b62231

Please sign in to comment.