Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to deploy to a remote machine using pipeline

Deleted user March 7, 2019

This partially a recommendation.

 

I was not able to find an easy introduction to setup a very basic deployment process using Bitbucket pipeline. During the first steps I do not need any fancy encryption, ....

 

So my workflow right now (which I inherited) is:

1. Develop stuff

2. Push to repository

3. Pipeline executes tests and builds a downloadable jar file.

4. As I lack the privileges to deploy on the respective machine, an authorized person has to download this jar and runs a local deployment script on the test machine.

5. As I lack the privileges to deploy on the respective machine, an authorized person has to download this jar and runs a local deployment script on the production machine.

 

I would like to change that, so that it looks basically like:

1. Develop stuff

2. Push to repository (test branch)

3. Pipeline executes tests, builds the project and deploys to test machine.

4. Merge test branch into master

5. Pipeline executes tests, builds the project and deploys to production machine.

 

It is as easy as that. Yet the whole setup really drives noobies to just use jenkins.

 

1 answer

1 vote
Graham Gatus
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 7, 2019

@[deleted] below is a sample pipeline which should achieve the pipeline you've described. Here, we run tests and automated deployments to a test environment from 'feature/*' branches, and run tests with manual deployment to production on 'master'. This models a continuous delivery scenario, where promotion of a release to the production environment is a manual step.

You can remove the manual trigger on the production deployment step to enable automated deployments and achieve continuous deployment.

pipelines:
default:
- step:
name: Run tests
script:
- echo "Execute tests"
branches:
feature/*:
- step:
name: Run tests
script:
- echo "Execute tests"
- step:
name: Deploy to test environment
deployment: test
script:
- echo "Deploying to test environment."

master:
- step:
name: Run tests
script:
- echo "Execute tests"
- step:
name: Deploy to production environment
deployment: production
trigger: manual
script:
- echo "Deploying to production environment."

 

A more detailed example can be found at https://confluence.atlassian.com/bitbucket/bitbucket-deployments-940695276.html

 

 

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events