Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,556,176
Community Members
 
Community Events
184
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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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
AUG Leaders

Atlassian Community Events