Report this

What is the reason for this report?

I have set up this pipeline on bitbucket to build my Gatsby app into a DigitalOcean droplet, but it fails.

Posted on February 28, 2022

We have a bitbucket repo done with React (GatsbyJS), and WP CMS, it builds normally on my local machine, also through SSH on DigitalOcean droplet. But when I want automate the task through this pipeline, it fails, why?

image: node:16.14.0

pipelines: default: - step:

name: Build Guidedby2

caches:

  • node

script:

  • npm install --legacy-peer-deps

  • npm run half-prod

artifacts:

  • public/**

  • step:

name: Deploy artifacts using SCP to PROD

deployment: production

script:

  • pipe: atlassian/scp-deploy:1.2.1

variables:

USER: $USER

SERVER: $SERVER

REMOTE_PATH: ‘/home/shalaw/guidedby-react/public’

LOCAL_PATH: ‘public/*’

SSH_KEY: $SSH_KEY



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

It’s hard to identify the exact issue without more specific error messages from your deployment pipeline, but I’ll list three common areas that might cause the pipeline to fail:

1. Environment Variables:

Make sure that the environment variables $USER, $SERVER, and $SSH_KEY are set correctly in your pipeline settings.

2. SSH Access:

Ensure that your bitbucket pipeline has the correct permissions to access and run commands in your DigitalOcean droplet.

3. Dependencies:

Be sure that all required dependencies are included in your package.json file and that npm install runs successfully.

If you are still facing this issue, you can further debug your pipeline in BitBucket to get more detailed error messages.

You might find this DigitalOcean documentation on droplets useful.

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.