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
Highlighted

Deploy code to custom server

Hi, my servers are not in Amazon or some similar hosting. How can I deploy my code to a custom webserver? Is there some tutorial for this?

Now I am deploying from my dev server, where I am starting a script, wchich is copyng all the code to my prod server with scp. How to do this from bitbucket deployment?

Thanks!

Nik

1 comment

Marty Atlassian Team Feb 09, 2019

Hi Nikolay,

Just confirming that you're using Bitbucket Cloud (bitbucket.org) rather than Bitbucket S Server (your own installation)?

If you are using Bitbucket Cloud, are you using Bitbucket Pipelines?

If so, you can set up custom deployment using Pipelines - here is a guide: https://confluence.atlassian.com/bitbucket/bitbucket-deployments-940695276.html

I hope that helps!

Like Nikolay Nikolov likes this

Hi Martyn, thanks!

I will play a bit with this deployment settings.

I have another question. When I use the steps for example for the branch feature/*

feature/*:
- step:
name: Build feature
script:
- echo "done Tests"
- step:
name: Deploy to staging
deployment: staging
trigger: manual
script:
- sh deploy/deploy.sh "staging" $BITBUCKET_BRANCH
- step:
name: Deploy to production
deployment: production
trigger: manual
script:
- sh deploy/deploy.sh "production" $BITBUCKET_BRANCH

Then I can not deploy direct to production, without to deploy to staging. Is there some possibility, where the QA can choose, where to deploy?

For example I want to set 3 feature servers, where the QA can deploy to test the branch:

Deploy to qa_server1 

Deploy to qa_server2

Deploy to qa_server3

At this moment the QA can not deploy direct to qa_server3, without to deploy on qa_server1 and qa_server2 .

How can I solve this?

Marty Atlassian Team Feb 10, 2019

Hi Nikolay,

 

One option to try is to use a number of custom pipelines.

Each custom pipeline must be triggered manually, and when you trigger it you can select which pipeline to trigger. 

You can read more about custom pipelines here: https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html#Configurebitbucket-pipelines.yml-ci_custom

So you could have the following pipelines:

1. Build feature (automatic) - would have only one step from your existing pipeline above*

2. Deploy to qa_server1

3. Deploy to qa_server2

4. Deploy to qa_server3

5. Deploy to production

 

I hope that helps!

Hi Martyn, how can I add custom script only for the branches feature/* 

Is this possible?

Marty Atlassian Team Feb 10, 2019

Do you mean get a pipeline to run for only some branches?

Here is an example to do just that: https://confluence.atlassian.com/bitbucket/branch-workflows-856697482.html 

Marty Atlassian Team Feb 10, 2019

If you're trying to get a step to run only for feature/* branches, you could run the custom script for every branch but add logic to the script that only executes certain steps based on the branch name.

Comment

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

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,615 views 0 6
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