Sign inSign up

tombras/rsync-node

By tombras

Updated over 6 years ago

Adds rsync and sshpass to node image for deploys

Image
0

287

tombras/rsync-node repository overview

#Docker image for Bitbucket Pipeline deployments via rsync with node support.

WARNING

The example below passed the --delete flag, 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 fabdeploy you need to create a bitbucket-pipelines-exclude.txt file from the ignore_list found in fabfile.json.

If you're using a root user the find . -type f -name "*.php" -exec chmod 700 {} \; maybe too strict, you can try find . -type f -name "*.php" -exec chmod 750 {} \; instead.

Example bitbucket-pipeline.yml

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>

Tag summary

Content type

Image

Digest

Size

354.9 MB

Last updated

over 6 years ago

docker pull tombras/rsync-node