I am learning about Pipelines. My objective is to use a pipeline to deploy the code to a Digitalocean server. The SSH and the Server is set.
The pipeline runs without errors but when I go to the server there is nothing there. How can I make cloned repository show up in the destination server?
name: Deploy to Staging
- apt-get update && apt-get install -y unzip git
- sh script_CloneOnly.sh
git clone --bare firstname.lastname@example.org:team1/myrepo.git
git fetch origin --tags
Then I get the following output:
+ sh script_CloneOnly.sh
Checking out the source repository
Cloning into bare repository 'myrepo.git'...
Warning: Permanently added the RSA host key for IP address '22.214.171.124' to the list of known hosts.
Entering the checked out repository
Downloading the source repository
Warning: Permanently added the RSA host key for IP address '126.96.36.199' to the list of known hosts.
* branch HEAD -> FETCH_HEAD
I expected to find the cloned repository in the server but there is nothing there. What is going wrong with my pipeline? Why I can't clone the repo to the server and keep it there?
There's nothing in your pipeline configuration pointing to your remote server in DigitalOcean. Your current script simply clones team1/myrepo repository onto machine that runs the pipeline, that is, Bitbucket machine, not the remote server.
Depending on what your desired deployment mechanism looks like, I'd expect to see either adding another remote to the repo (which is already there, provided by Pipelines, so you don't need to clone it again) and then git push, or maybe rsync, or something else to actually copy the files to the remote server in DigitalOcean.
Hope this helps. Let me know if you have any questions.
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...
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