switch between arti and default

This commit is contained in:
pratik
2025-10-15 14:28:38 -05:00
parent 4a84c08a2b
commit d7390a3a80
13 changed files with 749 additions and 8 deletions

View File

@@ -0,0 +1,42 @@
#!/bin/bash
# Script to switch between npm registries
# Usage: ./switch-registry.sh [public|artifactory]
set -e
REGISTRY_TYPE=${1:-public}
case $REGISTRY_TYPE in
public)
echo "Switching to public npm registry..."
cp .npmrc.public .npmrc
echo "✓ Now using registry.npmjs.org"
echo ""
echo "To install dependencies:"
echo " npm ci --force"
;;
artifactory)
echo "Switching to Artifactory registry..."
cp .npmrc.artifactory .npmrc
echo "✓ Now using Artifactory registry"
echo ""
echo "Make sure to set environment variables if authentication is required:"
echo " export ARTIFACTORY_AUTH_TOKEN=your_token"
echo ""
echo "To install dependencies:"
echo " npm ci --force"
;;
*)
echo "Usage: $0 [public|artifactory]"
echo ""
echo "Options:"
echo " public - Use registry.npmjs.org (default)"
echo " artifactory - Use Artifactory npm registry"
exit 1
;;
esac
echo ""
echo "Current .npmrc contents:"
cat .npmrc