WoozyMasta / archimate-ci-image

Archi container image for use in continuous integration pipelines
https://woozymasta.github.io/archimate-ci-image-example/?view=6213
MIT License
40 stars 23 forks source link

Feature request: Custom jasper report template #10

Open kokeksibir opened 1 year ago

kokeksibir commented 1 year ago

Hi! Is it possible to extend functionality to use a custom report template?

Archi cli accepts an argument --jasper.template for passing full path to the main.jrxml Jasper Reports template file.

WoozyMasta commented 1 year ago

Yes, it's possible, but I don't have time to implement it right now.

Therefore, I will gladly accept PR or wait until there is time to do it.

Might be worth just allowing any additional custom argument to be specified here in https://github.com/WoozyMasta/archimate-ci-image/blob/b38830882aebe5af4b6b85865733aaffd939fff6/entrypoint.sh#L84

kokeksibir commented 1 year ago

Hi @WoozyMasta thanks for reply.

I was going to allow custom arguments by modifying this line:

https://github.com/WoozyMasta/archimate-ci-image/blob/b38830882aebe5af4b6b85865733aaffd939fff6/entrypoint.sh#L45

into this:

local -a _args=("${@}")

Then I realized that when there are arguments provided to entrypoint, it behaves differently:

https://github.com/WoozyMasta/archimate-ci-image/blob/b38830882aebe5af4b6b85865733aaffd939fff6/entrypoint.sh#LL148C1-L153C3

In order not to break backwards compatibility I've decided not to remove these lines.

For now I modified my gitlab_ci file by adding another script call to generate jasper report, it works fine.

  script:
    - /opt/Archi/entrypoint.sh
    - /opt/Archi/entrypoint.sh --modelrepository.loadModel <project path> --jasper.createReport <project path>/public --jasper.format PDF --jasper.filename <project name> --jasper.title <project name> --jasper.template <project path>/report-template/main.jrxml

But that means it generates jasper report twice. I wanted to keep jasper report generation bc you inject PDF link to HTML page, which is cool.

Any suggestions?

WoozyMasta commented 1 year ago

@kokeksibir Okay, I'll try to find some time this weekend and try to implement it.

But I'm not promising anything yet.