damavis / airflow-hop-plugin

Apache Hop plugin for Apache Airflow - Orquestate Apache Hop pipelines and workflows from Airflow
Apache License 2.0
11 stars 6 forks source link

Update xml.py - Isolate hop project from application #27

Closed pauloricardoferreira closed 1 year ago

pauloricardoferreira commented 1 year ago

Hello.

Sorry for the English, I used google translator.

I would like to suggest a change to the xml.py file.

According to the documentation, it would be necessary to leave the hop artifacts in the home_home/project folder for the plugin to work correctly.

Analyzing the code I thought and tested the following solution.

the commented line is the original of the project and the line below is the change suggestion

self.project_folder = f'{hop_home}/{project["projectHome"]}'

if hop_home == self.project_home: self.project_folder = self.project_home else: self.project_folder = f'{hop_home}/{self.project_home}'

This way I can leave the hop project isolated from the hop application, gaining mobility.

for the documentation you could leave it like this: If your project is in a custom location, in the apache airflow connection configuration, home_home must be the same as the folder where your project is, so the plugin works correctly.

Attention: it is necessary that the hop artifacts are in the Airflow container, in the same path.

image

image