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

IgorPodlawski August 4, 2019

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
Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 5, 2019

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

Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 5, 2019

@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.

IgorPodlawski August 5, 2019

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?

Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 5, 2019

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

AnnSophieLangenfurth August 30, 2019

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
dynamiteReady November 18, 2019

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
dynamiteReady November 20, 2019

@Oleksandr Kyrdan Was this issue ever resolved?

0 votes
daffodilistic August 14, 2019

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.

Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 14, 2019

Hi @daffodilistic ,

you can try this

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

 

Cheers,
Alex

0 votes
Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 5, 2019

You can use provided example right now )

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events