It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Pipelines – script is not generating dist folder or it's not visible Edited

Hello!

I'm trying to use Bitbucket Pipelines to deploy my Nuxt.js based web app. Below there is my bitbucket pipelines config:

image: node

pipelines
:
custom:
init:
- step:
caches:
- node
script:
- yarn install
- yarn build --spa
- echo "$(ls -la dist/)"
-
ls
- step:
script:
- ls

And It is simplest as possible. It's installing all dependencies (yarn install) and using nuxt command yarn build --spa.

Yarn build --spa command is creating new dist folder and putting there build files. If dist folder were already existing script removes that folder and creates new dist folder. If I run this commands on my local machine I'm getting new dist folder filled with build files.

Whole steps are working fine, build step also, but finally there isn't any dist folder.

Zrzut ekranu 2019-08-4 o 17.16.47.png

Most related topic on the internet that I've found is that: https://github.com/nuxt/nuxt.js/issues/5344 – but is more about docker image than bitbucket pipeline. Is there anything that I can fix in my config without creating new docker image?

4 answers

2 votes

Hi @IgorPodlawski ,

Thank you for your feedback!


All should work well with the next Bitbucket pipelines config.

image: node

pipelines:
custom: # Pipelines that can only be triggered manually
init:
- step:
script:
- yarn install
- yarn build --spa
- echo "$(ls -la dist/)"
- ls
artifacts: # defining the artifacts to be passed to each future step.
- dist/**
- step:
script:
- ls

You can validate your bitbucket-pipelines.yml with the online validator.
Also to use `dist` directory in the next steps you should define artifacts.

Cheers, 
Alex

@IgorPodlawski 
For deploy we have ready to use pipes (SFTP deploy, SCP deploy, Rsync Deploy)

All available pipes you can discover on the Bitbucket Pipes page.

Thank you for your time @Oleksandr Kyrdan! I've heard about SFTP deploy and even was trying to use it, but since im stuck with dist folder I was trying to use just simple operations.

All should work well with the next Bitbucket pipelines config.

What is estimated release date of the next pipelines config?

@IgorPodlawski I mean, you can use current example that I've just provided.

Hello, 

I got the same problem. Got a nuxt app and the build steps are similar, just doing it with npm ;) 

Already added the artifacts and validate the .yml file. But the pipeline fails because no dist folder is created after build step and not shown at this console output: 

- echo "$(ls -la dist/)" 
- l

Any suggestion why dist/ is not created at build step in the pipeline? Locally everything works.

Screenshot after output of ls -la:

Bildschirmfoto 2019-08-30 um 22.22.12.png

Like dynamiteReady likes this

I'm also using Nuxt. I've been through the same steps. I'm trying to add an artefact, but the `dist` folder is never generated. Like the post above, the `ls -lsa' command shows that no `dist` directory was ever created at the end of the build process.

There's no error in the logs (even with `npm --verbose`), and the entire pipeline completes with an indication of success.

Is this not a bug?

Given @daffodilistic post, it sounds like it could possibly be a RAM issue, but without an error message, it's going to be extremely difficult to recreate that bug, especially on free accounts.

0 votes

You can use provided example right now )

I'd like to add that my build is failing too as a universal app.

However, on a "Hello World" application the build is fine. Is there anyway to get the output of the build step? There isn't any output during the npm run build command on Pipelines, whereas on localhost it shows the verbose build logs.

I've tried the debugging steps here: https://confluence.atlassian.com/bitbucket/debug-your-pipelines-locally-with-docker-838273569.html but it works correctly on the Docker image on localhost.

Hi @daffodilistic ,

you can try this

yarn build --spa --verbose > build.logs
cat build.logs

 

Cheers,
Alex

@Oleksandr Kyrdan Was this issue ever resolved?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,055 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you