I recently start using git and have some doubt about the best workflow.
1 - Is best to use an online repository like Bitbucket as intermetiate between my local and remote servers? O it will be better to deploy directly from local to remote?
I think it will be great to have this middle repository because it will be like a backup, but also will complicate my workflow.
2 - If I push my code to Bitbucket what is the best way to deploy the code to remote server? I have found some differents ways:
I want the more efective way in long terms that don't give me a lot of headaches. I don't mind to pay or learn something new (I never use capistrano..).
If you know any alternative way I would love to read about!
The key tenet of continuous delivery is keeping your code always releasable. In Bitbucket, that means you are doing feature branches with branch-based validation (automated/manual testing and code review), then merging to the default main branch with release-ready code that is automatically or manually deployed.
Bitbucket Pipelines is an integrated CI/CD service built into Bitbucket. It allows you to automatically build, test, and even deploy your code based on a configuration file in your repository. Essentially, we create containers in the cloud for you.
Sign in to the AWS Management Console, and open the AWS Developer Tools console at https://console.aws.amazon.com/codesuite/settings/connections . Choose Settings > Connections, and then choose Create connection. To create a connection to a Bitbucket repository, under Select a provider, choose Bitbucket.
I've just gone through the same setup myself with a rails 4 project I've been working on locally, and now deploying to a remote server.
You should most definitely be using some sort of source version control! I'm currently using bitbucket which has been awesome for my setup and workflow, as well as having the added benefit of being free for private repo's.
You are on the right track there, my workflow looks like this currently:
local dev -> commit to bitbucket Then using capistrano, even though the script is run locally the actions still get fired remotely on the server, so that looks like this.
(bitbucket repo)
^
|
(local dev) deploy capistrano -> (server) fetches from bitbucket and runs capistrano commands
The first two resources detail the process I followed: http://robmclarty.com/blog/how-to-deploy-a-rails-4-app-with-git-and-capistrano
http://matteodepalo.github.io/blog/2013/03/07/how-i-migrated-from-heroku-to-digital-ocean-with-chef-and-capistrano/
When you want to get a little more fancy and automated I suggest adding in something like Chef that you can use to configure the server itself (so you can spin up VM's or VPS's and run a few scripts to have it setup in a couple minutes as opposed to installing all the packages manually)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With