DEV Community

Cover image for Automated script - Upload front end artifacts to nexus
Ratheesh kumar R
Ratheesh kumar R

Posted on • Edited on

Automated script - Upload front end artifacts to nexus

Hello Pal

Scenario : A FE developer working in an Angular project. He is building angular using angular build command and zip the output and upload to nexus and deploy using Jenkins or any tools.

I created some file which help a developer to do all this until upload to nexus with a single command.

This command programmatically upload angular atifacts to nexus using node

Repo : https://github.com/ratheeshspiral09/angularbuidtonexus

Steps to do that

  1. Install dev dependencies "web-nexus-deployer": "^1.0.2", "archiver": "^5.3.0"

2.Make sure the version key in package.json matches your release
verison eg: "version": "5.7.0"

3.Set NEXUS_USERNAME and NEXUS_PASSWORD as env variables in the
terminal like below or add it in .bashrc file.

export NEXUS_USERNAME=username
export NEXUS_PASSWORD=password

4.Run npm run deploy-to-nexus in terminal

To customize any more please check build.js and deploy.js files

Working

Here build.js file will find the files for artifacts (here in dist folder) and convert it into zip deploy.js file will deploy the same zip to nexus based on the values given in that file like groupid,artificat id etc

Top comments (0)