Skip to main content

How to customize .cpanel.yml in this scenario?

Comments

4 comments

  • cPanelLauren
    I believe the information here - specifically the bash command examples might be useful: Guide to Git - Deployment - cPanel Knowledge Base - cPanel Documentation But I don't think there is a way to exclude files natively though you might be able to write a the cp to exclude - there's a pretty informational discussion on this here: How to use 'cp' command to exclude a specific directory?
    0
  • jalil1408
    the documentation needs more details about the syntax used in `.cpanel.yml`, for example: - can you use `/bin/rsync` instead of `/bin/cp`? - can you use different name than `DEPLOYPATH`? - what does `export` do? and can you use multiple `export` statements?
    0
  • cPanelLauren
    While I do definitely agree this could use more examples, I believe you can use any bash commands here. You can read the man page about export from the CLI: man export
    Essentially though: Set an environment variable. The supplied names are marked for automatic export to the environment of subsequently executed commands.
    0
  • jalil1408
    this works fine: --- deployment: tasks: - export ROOT=/home/maahadonline/ - /bin/ls -A -I ".git" -I "public" | /bin/xargs -I % /bin/cp -ru % $ROOT # print without copy : - /bin/ls -A -I ".git" -I "public" | /bin/xargs -t -I % /bin/cp -ru % $ROOT - export PUBLIC=/home/maahadonline/public_html/ - /bin/ls -A -I ".htaccess" public | /bin/xargs -I % /bin/cp -ru public/% $PUBLIC # print without copy : - /bin/ls -A -I ".htaccess" public | /bin/xargs -t -I % /bin/cp -ru public/% $PUBLIC
    0

Please sign in to leave a comment.