Adds rsync and sshpass to node image for deploys
287
#Docker image for Bitbucket Pipeline deployments via rsync with node support.
WARNING
The example below passed the
--deleteflag, if you're not deploying to a webroot, such as, your project contains a webroot and is deployed in a folder with shared system files this option could blow things up.If you're migrating over from
fabdeployyou need to create a bitbucket-pipelines-exclude.txt file from theignore_listfound in fabfile.json.If you're using a
rootuser thefind . -type f -name "*.php" -exec chmod 700 {} \;maybe too strict, you can tryfind . -type f -name "*.php" -exec chmod 750 {} \;instead.
image: tombras/rsync-node
pipelines:
branches:
master:
- step:
deployment: test
script:
- find . -type d -exec chmod 755 {} \;
- find . -type f -exec chmod 644 {} \;
# super secure permissions
#- find . -type f -name "*.php" -exec chmod 700 {} \;
- sshpass -p $RSYNC_PASSWORD rsync -pthrvz --delete --exclude='.git/' --exclude-from='.gitignore' --exclude-from='bitbucket-pipelines-exclude.txt' ./ <USER>@<HOSTNAME>:<DIR_NAME>
- step:
deployment: staging
trigger: manual
script:
- find . -type d -exec chmod 755 {} \;
- find . -type f -exec chmod 644 {} \;
# super secure permissions
#- find . -type f -name "*.php" -exec chmod 700 {} \;
- sshpass -p $RSYNC_PASSWORD rsync -pthrvz --delete --exclude='.git/' --exclude-from='.gitignore' --exclude-from='bitbucket-pipelines-exclude.txt' ./ <USER>@<HOSTNAME>:<DIR_NAME>
- step:
deployment: production
trigger: manual
script:
- find . -type d -exec chmod 755 {} \;
- find . -type f -exec chmod 644 {} \;
# super secure permissions
#- find . -type f -name "*.php" -exec chmod 700 {} \;
- sshpass -p $RSYNC_PASSWORD rsync -pthrvz --delete --exclude='.git/' --exclude-from='.gitignore' --exclude-from='bitbucket-pipelines-exclude.txt' ./ <USER>@<HOSTNAME>:<DIR_NAME>
Content type
Image
Digest
Size
354.9 MB
Last updated
over 6 years ago
docker pull tombras/rsync-node