[ 
https://issues.apache.org/jira/browse/FREEMARKER-142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Siegfried Goeschl updated FREEMARKER-142:
-----------------------------------------
    Description: 
h2. Overview

Currently ony a single FreeMarker Template can be transformed with a single 
command line invocation - I suggest to add the following functionality

* Transform an input directory recursively into an output directory
* If a template ends with ".ftl" the extension will be removed after processing
* Only a single directory is support
* Currently no inclusion / exlusion pattern for templates are supported

h2.  Examples 

h3. Transform Template Directory To STDOUT

{noformat}
appassembler> ./bin/freemarker-cli -t site/template/
# == application.properties ==================================================
server.name=localhost
server.logs=/var/log/nginx
# == nginx-conf =============================================================
server {
  listen 80;
  server_name 127.0.0.1;

  root /usr/share/nginx/www;
  index index.htm;
}
{noformat}

h3. Transform Template Directory To Directory

{noformat}
appassembler> ./bin/freemarker-cli -t site/template/ -o out; ls -l out
total 8
-rw-r--r--  1 sgoeschl  staff  128 May 30 20:02 application.properties
drwxr-xr-x  3 sgoeschl  staff   96 May 30 20:02 nginx
{noformat}

h3. Pass Parameter On The Command Line

{noformat}
appassembler> ./bin/freemarker-cli -t site/template/ -P NGINX_HOSTNAME=localhost
# == application.properties ==================================================
server.name=localhost
server.logs=/var/log/nginx
# == nginx-conf =============================================================
server {
  listen 80;
  server_name localhost;

  root /usr/share/nginx/www;
  index index.htm;
}
{noformat}

h3. Use Environment Variables

{noformat}
appassembler> export NGINX_PORT=8080
appassembler> ./bin/freemarker-cli -t site/template/ -m env:///
# == application.properties ==================================================
server.name=localhost
server.logs=/var/log/nginx
# == nginx-conf =============================================================
server {
  listen 8080;
  server_name 127.0.0.1;

  root /usr/share/nginx/www;
  index index.htm;
}
{noformat}

h3. Use Environment File

{noformat}
appassembler> echo "NGINX_PORT=8080" > nginx.env
appassembler> ./bin/freemarker-cli -t site/template/ -m nginx.env 
# == application.properties ==================================================
server.name=localhost
server.logs=/var/log/nginx
# == nginx-conf =============================================================
server {
  listen 8080;
  server_name 127.0.0.1;

  root /usr/share/nginx/www;
  index index.htm;
}
{noformat}

h3. Use JSON File

{noformat}
appassembler> echo '{"NGINX_PORT":"8080","NGINX_HOSTNAME":"localhost"}' > 
nginx.json
appassembler> ./bin/freemarker-cli -t site/template/ -m nginx.json 
# == application.properties ==================================================
server.name=localhost
server.logs=/var/log/nginx
# == nginx-conf =============================================================
server {
  listen 8080;
  server_name localhost;

  root /usr/share/nginx/www;
  index index.htm;
}
{noformat}


  was:
h2. Overview

Currently ony a single FreeMarker Template can be transformed with a single 
command line invocation - I suggest to add the following functionality

* Transform an input directory recursively into an output directory
* If a template ends with ".ftl" the extension will be removed after processing
* Only a single directory is support
* Currently no inclusion / exlusion pattern for templates are supported

h2.  Examples 

h3. Transform Template Directory To STDOUT

{noformat}
appassembler> ./bin/freemarker-cli -t site/template/
# == application.properties ==================================================
server.name=localhost
server.logs=/var/log/nginx
# == nginx-conf =============================================================
server {
  listen 80;
  server_name 127.0.0.1;

  root /usr/share/nginx/www;
  index index.htm;
}
{noformat}

h3. Transform Template Directory To Directory

{noformat}
appassembler> ./bin/freemarker-cli -t site/template/ -o out; ls -l out
total 8
-rw-r--r--  1 sgoeschl  staff  128 May 30 20:02 application.properties
drwxr-xr-x  3 sgoeschl  staff   96 May 30 20:02 nginx
{noformat}

h3. Pass Parameter On The Command Line

{noformat}
appassembler> ./bin/freemarker-cli -t site/template/ -P NGINX_HOSTNAME=localhost
# == application.properties ==================================================
server.name=localhost
server.logs=/var/log/nginx
# == nginx-conf =============================================================
server {
  listen 80;
  server_name localhost;

  root /usr/share/nginx/www;
  index index.htm;
}
{noformat}

h3. Use Environment Variables

{noformat}
appassembler> export NGINX_PORT=8080
appassembler> ./bin/freemarker-cli -t site/template/ -m env:///
# == application.properties ==================================================
server.name=localhost
server.logs=/var/log/nginx
# == nginx-conf =============================================================
server {
  listen 8080;
  server_name 127.0.0.1;

  root /usr/share/nginx/www;
  index index.htm;
}
{noformat}

h3. Use Environment File

{noformat}
appassembler> echo "NGINX_PORT=8080" > nginx.env
appassembler> ./bin/freemarker-cli -t site/template/ -m nginx.env 
# == application.properties ==================================================
server.name=localhost
server.logs=/var/log/nginx
# == nginx-conf =============================================================
server {
  listen 8080;
  server_name 127.0.0.1;

  root /usr/share/nginx/www;
  index index.htm;
}

h3. Use JSON File

appassembler> echo '{"NGINX_PORT":"8080","NGINX_HOSTNAME":"localhost"}' > 
nginx.json
appassembler> ./bin/freemarker-cli -t site/template/ -m nginx.json 
# == application.properties ==================================================
server.name=localhost
server.logs=/var/log/nginx
# == nginx-conf =============================================================
server {
  listen 8080;
  server_name localhost;

  root /usr/share/nginx/www;
  index index.htm;
}
{noformat}



> [freemarker-cli] Support Transformation Of Directories
> ------------------------------------------------------
>
>                 Key: FREEMARKER-142
>                 URL: https://issues.apache.org/jira/browse/FREEMARKER-142
>             Project: Apache Freemarker
>          Issue Type: Task
>            Reporter: Siegfried Goeschl
>            Assignee: Siegfried Goeschl
>            Priority: Major
>
> h2. Overview
> Currently ony a single FreeMarker Template can be transformed with a single 
> command line invocation - I suggest to add the following functionality
> * Transform an input directory recursively into an output directory
> * If a template ends with ".ftl" the extension will be removed after 
> processing
> * Only a single directory is support
> * Currently no inclusion / exlusion pattern for templates are supported
> h2.  Examples 
> h3. Transform Template Directory To STDOUT
> {noformat}
> appassembler> ./bin/freemarker-cli -t site/template/
> # == application.properties ==================================================
> server.name=localhost
> server.logs=/var/log/nginx
> # == nginx-conf =============================================================
> server {
>   listen 80;
>   server_name 127.0.0.1;
>   root /usr/share/nginx/www;
>   index index.htm;
> }
> {noformat}
> h3. Transform Template Directory To Directory
> {noformat}
> appassembler> ./bin/freemarker-cli -t site/template/ -o out; ls -l out
> total 8
> -rw-r--r--  1 sgoeschl  staff  128 May 30 20:02 application.properties
> drwxr-xr-x  3 sgoeschl  staff   96 May 30 20:02 nginx
> {noformat}
> h3. Pass Parameter On The Command Line
> {noformat}
> appassembler> ./bin/freemarker-cli -t site/template/ -P 
> NGINX_HOSTNAME=localhost
> # == application.properties ==================================================
> server.name=localhost
> server.logs=/var/log/nginx
> # == nginx-conf =============================================================
> server {
>   listen 80;
>   server_name localhost;
>   root /usr/share/nginx/www;
>   index index.htm;
> }
> {noformat}
> h3. Use Environment Variables
> {noformat}
> appassembler> export NGINX_PORT=8080
> appassembler> ./bin/freemarker-cli -t site/template/ -m env:///
> # == application.properties ==================================================
> server.name=localhost
> server.logs=/var/log/nginx
> # == nginx-conf =============================================================
> server {
>   listen 8080;
>   server_name 127.0.0.1;
>   root /usr/share/nginx/www;
>   index index.htm;
> }
> {noformat}
> h3. Use Environment File
> {noformat}
> appassembler> echo "NGINX_PORT=8080" > nginx.env
> appassembler> ./bin/freemarker-cli -t site/template/ -m nginx.env 
> # == application.properties ==================================================
> server.name=localhost
> server.logs=/var/log/nginx
> # == nginx-conf =============================================================
> server {
>   listen 8080;
>   server_name 127.0.0.1;
>   root /usr/share/nginx/www;
>   index index.htm;
> }
> {noformat}
> h3. Use JSON File
> {noformat}
> appassembler> echo '{"NGINX_PORT":"8080","NGINX_HOSTNAME":"localhost"}' > 
> nginx.json
> appassembler> ./bin/freemarker-cli -t site/template/ -m nginx.json 
> # == application.properties ==================================================
> server.name=localhost
> server.logs=/var/log/nginx
> # == nginx-conf =============================================================
> server {
>   listen 8080;
>   server_name localhost;
>   root /usr/share/nginx/www;
>   index index.htm;
> }
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to