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):
- rsync -rvz . email@example.com:/path/to/website/ # upload code
- ssh firstname.lastname@example.org "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.
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.
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!
...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...
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