Giter Club home page Giter Club logo

Comments (12)

Destreyf avatar Destreyf commented on June 4, 2024 2

I just wanted to chime in here.

I am using a self hosted drone.io and cannot get the build to succeed, however if i run it on my laptop it fails every other time it's run.

What's even stranger is even with debug set to true in my env.json and setting SLS_DEBUG to true, i get inconsistent debug messages.

To improve my odds of deployment i have broken my builds into 2 steps.

# First we create a package, I modified my angular.json to have this run target.
npx ng run api:package
# Next i run the deploy on the built asset
SLS_DEBUG=true npx serverless deploy --package dist/apps/api/.serverless/ --config apps/api/serverless.yml

The line in my angular.json file is as follows

        "package": {
          "builder": "@flowaccount/nx-serverless:sls",
          "options": {
            "command": "package",
            "buildTarget": "api:build:production",
            "config": "apps/api/serverless.prod.yml",
            "location": "dist/apps/api",
            "package": "dist/apps/api"
          }
        },

This is placed just below the "serve" option in my config for the api "project".

I had to install YARN for the sole purpose of even getting the builds to work due to the dependency tree shaking that this tries to do.

I really like this project, I just wish the builds were more reliable, instead of having to run the package command 2-4 times before I can run a deploy.

I have an other project I plan on using nx-serverless on, I'm planning on spending more time looking into the cause of the build issues as it prevents me from being able to do an automated deploy from my CI/CD system.

from nx-plugins.

Destreyf avatar Destreyf commented on June 4, 2024 1

You may have a workspace.json file that's similar to the angular.json file, basically what I added as a run target for the nx cli that does the packaging.

from nx-plugins.

wickstargazer avatar wickstargazer commented on June 4, 2024 1

@Destreyf i have been facing similar issues after scaling. So i am in fix for that, but i am going to release v0.5.3 in a few days and it will fix the npm issue. You will be able to use npm. For the packaging issue there might be several causes which i am investigating. But it might be release as v1.0.0 in a month time.

from nx-plugins.

wickstargazer avatar wickstargazer commented on June 4, 2024

Is this for angular universal app?

from nx-plugins.

dbrrt avatar dbrrt commented on June 4, 2024

@wickstargazer It's for serverless framework plugin.

from nx-plugins.

Destreyf avatar Destreyf commented on June 4, 2024

To further clarify, I do not have issues with SLS_DEBUG when doing other serverless tasks, only tasks related to nx-serverless.

from nx-plugins.

dbrrt avatar dbrrt commented on June 4, 2024

@Destreyf Same, with nx-serverless, It's stopping for me at packaging step, with no error, where using sls commands standalone, the deployment processes just fine.

from nx-plugins.

Destreyf avatar Destreyf commented on June 4, 2024

@dbrrt Can you add the build config to your angular.json file and try running the following command:

SLS_DEBUG=true npx ng run api:package

Does it show any messages? I do get past packaging, albeit inconsistently.

from nx-plugins.

dbrrt avatar dbrrt commented on June 4, 2024

@Destreyf I'm not using angular.json, will try in the package.json, are you able to package the lambda with the plugin?

from nx-plugins.

dbrrt avatar dbrrt commented on June 4, 2024

Makes sense, I'll try that.

from nx-plugins.

wickstargazer avatar wickstargazer commented on June 4, 2024

Hi i think the above problem is broken down into two issues?

  1. Being the sls documentation is not clear
  2. The npm doesn't work.

Am i right? @Destreyf I am fixing the npm and will add some documentations you suggested into the readme somewhere.

Thankz

from nx-plugins.

Destreyf avatar Destreyf commented on June 4, 2024

@wickstargazer I don't know if there's been releases since my last message, the project I used this on has been on hold, I am actually circling back to it this week.

At the time of my message, the real issue was the deploy portion of the SLS command wasn't working consistently, this was actually an issue with the Package step, so I could run the package command multiple times until it succeeded (I had to have yarn installed for it to even work at all) and then once it succeeded, because I broke the deploy into two steps, I could successfully deploy.

This was/is particularly frustrating if you're trying to use a CI/CD system, because it always fails on the first attempt no matter what, which CI/CD systems are blank slates each run, essentially making it impossible to automate deployments.

from nx-plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.