how to run a NuxtJS project automatically - vue.js

NuxtJS project management is developed on GitHub.
The following is the development procedure.
1.Push updates from your local PC to the GitHub remote repository.
2.Log in to your hosting server and pull the remote repository to retrieve the differences.
3.Then run npm run build and npm run generate to update the project.
Is there a way to run npm run * automatically after downloading the differences from the remote repository?

I think you are looking for GitHub webhooks. See the documentation here.

Related

How to reference npm project locally?

I am using npm, yarn build as manager tool. Using these tech, create two project , CommonLib and SampleProject. so first I build CommonLib project, release its library and publish it to AWS codeartifact then ref that published artifact to SampleProject.
This flow looks fine and works well as well. But this whole process force us to publish our changes to artifact which block other.
So not think to do change locally in IDE (here is mscode), release it locally and then ref it to SampleProject.
I used npm install ../CommonLib command to install the package and IDE start point to locally project. But it doesn't compile the project.
Can anyone help me on this, what could be wrong here.

Add npm run build to Fortrabbit deploy process

Using Fortrabbit to deploy a PHP app which uses a node project for the front end. Is there any way in which I can add npm run build to the deploy process instead of having to always build first manually and then deploying it through Fortrabbit?
(There is a fortrabbit.yaml file on the fortrabbit site that needs to be configured for every fortrabbit app but the example doesn't show how we can add that command in the deployment pipeline.)
Sorry. There is no way to run Node JS during deployment on fortrabbit yet.

Nuxt webapp deployment through azure pipelines

i'm already thankfull for anyone reading this.
I've stumbled across some problems trying to deploy a Nuxt application in a correct way. For testing purposes i've created a clean installed Nuxt application so i'm sure nothing is wrong with my codebase. What my ultimate goal is is to push all my nuxt code to github which than gets picked up from a azure deployment pipeline and generates the needed build files and drops them to the webapp service and runs the needed start command. There's no documentation to be find about Azure which is really annoying for me. I'm not used to deploying stuff through a pipeline but need this to be working for this project.
Has anyone experience with Nuxt and deployments through Github -> Azure pipeline -> Build -> Web app running immediatly
What's i've tried already is pushing all the source code to a repository which get's picked up by azure pipeline. The only thing the pipeline does is paste the code in the wwwroot folder. Which is obviously not enough to make the application run automated.
What i expect is some insight from someone who is experienced with nuxt and azure deployments through github/bitbucket (doesn't really make a difference)
You have to configure your pipeline to build the nuxt files and deploy them. You can usually achieve the first step through npm commands, npm install then npm run build.
There's a few different ways to deploy them, which you'll have to decide between depending on your use case and environment. You can create an endpoint pointing to a CDN serving a blob, zip the built files and publish the artifact which is then used by a release pipeline, etc. Once the next files are created, you have all you need to deploy.

Recommended way to deploy Nuxt.js App with Express

I'm looking into using Nuxt.js for a new Web application with an Express server / API attached in the project itself. I've created the Nuxt.js application with the npx create-nuxt-app command and selected Express as "custom server framework".
When using the development environment (npm run dev), it works like a charm. Now, I want to deploy the application to a server which is running pm2 using Gitlab CI. I struggle with the right way to deploy the application, as I don't think I should "upload" the sourcecode to the server and then run the neccessary commands like npm run build or npm start. So, what is actually "the right way" to deploy this application with the server?
I have SSH access to a server where I want to deploy this application & API. The server is running pm2 for managing the Node processes.
Furthermore, the sourcecode is in a repository on a Gitlab server with a Gitlab CI Runner available. The current gitlab-ci.yml does the following:
npm install
npm run build
lftp the dist folder to the server
With a SPA, only the client is built and the server / API is not. We now have a, in my opinion, dirty workaround which doesn't work very well that does the following:
npm install
npm run build
mirror the whole project to the server
use a watcher in pm2 to detect changes in files
build project again???
It looks like it doesn't work as intended and I have the feeling we are creating problems instead of solving the deployment issue the right way. We don't use Heroku, Google or any other services for hosting the application, it's just a webhosting with SSH access basically.

Publish ember addon to local NPM registry for developer builds?

How can I support these NPM/ember addon scenarios?
developers build ember addon A and use build ember application B which uses their A local package
developers only builds B installing A from our nexus NPM integration repository
build system builds ember addon A installing into our nexus NPM release repository
Maven
developer desktop builds install packages to a local repo to be used later in the build.
build system builds deploy packages to our internal shared repo to be used by developers so they don't need to build all
NPM
build system builds can use npm publish --registry http://ourrepo/nexus/.... to publish into a private registry
develop desktop builds do????
We could use DependsOnMe with relative paths but that requires us to setup some kind of rule where builds work one way locally and another on the build machine.
While possible, I hope there's a more elegant solution to making this happen.
Can I have developers generate packages that go into the local npm cache for later use and if so can you point me to that documentation?
Related
locally build npm package in project
nexus npm deploy doc
Because we use maven front end plugin to manage npm and ember we can encapsulate an additional npm module (in this case an ember addon) as a maven artifact and make use of maven dependency management for our various scenarios
Ember Add On module
add 'npm pack' to generate local package in npm repository (in our case root/target/tmp/.npm//)
add assembly to generate tar.gz containing tar file (a little silly) and attach it to module as an artifact (type: tar.gz, classifer: ember-addon)
Client module
add maven-dependency-plugin unpack which unpacks addon module's tar.gz classifier: ember-addon to target/ember-addons prior to npm execution for this module
modify package.json to use local dependency "our-addon" : "file:../../target/ember-addons///package.tgz"
If a user builds ember and client, then addon module build placing the artifact in local maven repository. Client module unpacks from local repository and pulls into node_modules via npm ember build process.
If a user only builds client, then client module fetches addon artifact from our nexus repository prior to the unpack and use phases.