I need to deploy the same repository in different paths based on the current path of this file
Example:
If this .Cpanel.yml is in the repository located at "/ home / foo / repository / foo_prod /", implement it at / home / foo / public_html / production_folder / but if the file location binder . cpanel.yml is in "/ home / foo / repository / foo_pre_prod /" so implement it in / home / foo / public_html / pre_prod_folder /
Example:
If this .Cpanel.yml is in the repository located at "/ home / foo / repository / foo_prod /", implement it at / home / foo / public_html / production_folder / but if the file location binder . cpanel.yml is in "/ home / foo / repository / foo_pre_prod /" so implement it in / home / foo / public_html / pre_prod_folder /
Code:
Current file .cpanel.yml
---
deployment:
tasks:
- export DEPLOYPATH=/home/foo/public_html/xyz/
- /bin/cp -R * $DEPLOYPATH
--------end
idea file .cpanel.yml
---
deployment:
tasks:
- $FOLDER_TO_DEPLOY = (current_file_path = "/home/..../foo") ? "prod" : "pre_prod";
- export DEPLOYPATH=/home/foo/public_html/$FOLDER_TO_DEPLOY
- /bin/cp -R * $DEPLOYPATH