#!/bin/bash
set -e
cat << EOF > .npmrc


@p81-common:registry=https://nexus.perimeter81.com/repository/npm-common
//nexus.perimeter81.com/repository/:email=$NEXUS_USER
//nexus.perimeter81.com/repository/:_auth=$(echo -n "$NEXUS_USER:$GLOBAL_CICD_NEXUS_PASSWORD" | openssl base64)
//nexus.perimeter81.com/repository/:always-auth=true


//registry.npmjs.org/:_authToken=$GLOBAL_CICD_NPM_TOKEN

EOF


echo running npm install

npm install

echo done