Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Best practice for pipeline server deployment

We are evaluating pipelines for our continuous deployments and I'm hitting something of a roadblock. Our current deployment strategy uses rsync to upload changes to our dev and staging servers. Unfortunately, rsync isn't a great solution with Bitbucket pipelines because the docker container does a fresh git pull of the repo branch. This means rsync will always copy all the files rather than just the changes from the last commit. I realize it will be slightly more efficient since it should still just copy diffs of the data, but it will still always consider all the files rather than commit changes.

Any ideas here about a deployment script? Our platform is CakePHP so it's all PHP files and web assets.

3 answers

1 accepted

1 vote
Answer accepted
Tom Bradshaw Atlassian Team Dec 20, 2016

Hey @David Ethell,

There is a flag you can pass to rsync to make it ignore the timestamps of the files and rely only on the checksum. The flag is --ignore-times which should make your rsync command look something like this:

rsync --ignore-times <folder1> <folder2>

This should prevent unnecessary copies.

However, whether this is a good idea depends on what you're trying to accomplish. Calculating the checksums can be an expensive operation which may lead to longer build times.

Cheers,

Tom

For some reason I was worried that checksum calculation would slow things down, but this has greatly improved the run times and now correctly only uploads changed files. Thanks!

0 votes

I'm not sure how git-settimes gist works. But it may be running into issues due to timezone differences. Your local commits may be on a different timezone to Pipelines. Pipelines runs on UTC. Your idea here makes sense, but maybe timezones are making things problematic for you here? smile

I tried using this git-settimes gist to set the checked out timestamps in a way that should allow rsync to only upload changes but so far it does not appear to help.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

4,413 views 12 15
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you