Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,367,221
Community Members
 
Community Events
168
Community Groups

How to deploy BitBucket download artifact to my home server (ubuntu)

Edited

I have a NestJS app with Postgres running using docker-composer. I am new to BitBucket and trying to figure out how to deploy my BitBucket download artifact to my home server. So far I have:

  1. written a bitbucket-pipelines.yml
  2. Up and running runner
  3. Add SSH keys
 Anyone can point me to the right directions? I would really appreciate it. Thanks

 

image: docker/compose
options:
  docker: true

pipelines:
  default:
    - step:
        name: 'Build images'
        runs-on:
          - self.hosted
          - linux
        script:
          - docker-compose down
          - docker-compose build
        artifacts:
          - ./
        services:
          - docker
    - step:
        name: Deploy to staging
        deployment: Staging
        artifacts:
          download: 'true'
        trigger: 'manual'
        script:
          - docker-compose up -d
          - docker-compose ps

1 answer

0 votes
Pramodh M Community Leader Aug 26, 2022

Hi @Mike Bernal 

Welcome to the community 🙂

Have you tried manually running commands in runner once with the docker-compose and curl command?

Also store the artifacts in separate folder by creating one

Pipeline looks correct syntactically.

Try once and see if it succeeds

 Thanks

During the step: Build images my VM runs these containers:

ds.png

Then in deployment step, it stops and removes these containers.

and display an error:

curl.png

it doesn't create a directory to my vm.

Pramodh M Community Leader Aug 26, 2022

@Mike Bernal 

Have you tried manaully testing the script?

and try it with creating a folder for artifact

Sorry but how do I manually test the script and create a folder for the artifact?

The program works fine if I clone my bitbucket repo inside the vm without the pipelines.

Pramodh M Community Leader Aug 26, 2022

@Mike Bernal 

Manually in the sense test the commands in linux server 

creating the folder would be refering it has ./artifact/ after creating the folder

Can you show me how to do it by editing the above .yml if you don't mind.

I am using docker-compose to run my services to my own server. What is happening was ithe docker images is successully building and running in the pipelines however, how can I run it instead in my server through the runner? It is not doing it's purpose.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS

Atlassian Community Events