Hi
I want to deploy the code that I have in bitbucket to my remote server. After that some other tasks.
I have the keys, known host fingerprint is fetched. Now I need to know how to tell bitbucket on commit, deploy my code to a simple VM and restart httpd.
How to do that?
Try putting in the commands you use to deploy code to the VM from your machine. Uploading the code could be done using rsync (or scp/sftp, depending on what you prefer):
pipelines:
default:
- step:
script:
- rsync -rvz . user@my.server.com:/path/to/website/ # upload code
- ssh user@my.server.com "httpd -k graceful" # restart apache
Note that you don't normally need to restart Apache to pick up changed files. They should appear as soon as you change the files with rsync. So only the first command above should be necessary to deploy your code.
If you're still having trouble, a bit more information about the type of project you're deploying, what hosting you're using, and any error messages, would help us be more specific.
Thanks!
That did the job. The apache restart command is just so i could know how to run some other commands if there is some need.
The hardest part for me was to find out what kind of logic is needed to run some common bash one line commands. If there is some official documentation for the same problem, could you please refer it. If not, could you please create it. Some times the easiest things can get challenging and hinder further tasks.
It would be great to see some full real life examples on how different teams have built their whole pipelines and deployment systems. At the moment it is not so easy to find some good mature examples.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ragnar,
Glad Matt was able to help you out! (for context, I'm the new writer for Bitbucket Pipelines)
Whilst we do have some examples which incidentally have some basic code in, in our configure bibucket-pipelines.yml page we really don't have anything that makes the whole journey obvious with real world type examples, and that's something I'm hoping to change as I settle into the role.
Thanks for getting involved with the community, and I hope your journey with Pipelines is a great one!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.