Forums

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

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

Mike Bernal August 26, 2022

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 Champion
August 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

Mike Bernal August 26, 2022

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 Champion
August 26, 2022

@Mike Bernal 

Have you tried manaully testing the script?

and try it with creating a folder for artifact

Mike Bernal August 26, 2022

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 Champion
August 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

Mike Bernal August 28, 2022

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
AUG Leaders

Atlassian Community Events