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.
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?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@IgorPodlawski I mean, you can use current example that I've just provided.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @daffodilistic ,
you can try this
yarn build --spa --verbose > build.logs
cat build.logs
Cheers,
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use provided example right now )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.