Forums

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

Basic steps to deploy

Miguel Pragier
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 15, 2018

Hi all!

I'm new to deploy automation.

Here we have a backend app made in golang, coded by a team with two developers.

Our code is versioned in bitbucket git.

The deploy environment is a DigitalOcean droplet (vps).

I'm not using Docker, once each app runs in a dedicated server. But if you tell me a good reason, I'll be happy to use it.

Our goal is to send one directory with an executable, one static assets directory and a single  config json file.

 

Our current procedure today is:

- Git push to master;

- Git pull ( from target/deploy server )

- delete previous version

- go build and copy the executable to target directory

- copy the other asset files to destiny folder

- run the app ( as nohup )

- exit.

 

How to move from this manual procedure to automated mode, considering our simple scenario?

Is Bitbucket Pipelines the best option?

Is it better to build in my machine and send the executable, or git-pull from deploy machine and then build there?

Should I use another ci tool, like rundeck?

 

Am I looking to the wrong direction?

1 answer

0 votes
Geoff Crain
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 16, 2018

Hi Miguel,

Pipelines is definitely the best option :).

I would suggest in your move to automate this, that you first keep it simple - keep it close to what you're currently doing.

I'm not entirely clear on how you're deploying, but hopefully some of this will help.

I would split your pipeline into 2 steps - one to go build and produce the executable and asset files as artifacts to be passed to the next step: https://confluence.atlassian.com/bitbucket/using-artifacts-in-steps-935389074.html

In your deployment step (https://confluence.atlassian.com/bitbucket/bitbucket-deployments-940695276.html) mark the step as "deployment: production", and use rsync commands to push the artifacts to your server.

I'm not 100% clear on the shut down / restart of your app, but if you need to do that remotely before / after the rsync, you can ssh to your server from pipelines using: https://confluence.atlassian.com/bitbucket/use-ssh-keys-in-bitbucket-pipelines-847452940.html

Let us know how you go.

Cheers,

Geoff

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events