0.0.9 • Published 1 year ago

@grantstrachan/npm-packaging-test v0.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Node Express demo project

Developers testing Nexus3 repository manager start here:

Use .env.template to create a local .env file to store the relevent variables or replace variables placeholder in the below commands before running commands

source .env

NPM

This operation confirms that all package dependencies are being pulled via Nexus as your main NPM proxy

npm conf set always-auth true

npm conf set registry $NPM_REPO_URL

npm conf set email $NPM_EMAIL

npm conf set _auth $NPM_RO_BASE64_STRING

cat package.json.template |sed "s/NPM_PACKAGE_VERSION/${NPM_PACKAGE_VERSION}/" > package.json

npm install

DOCKER

  • Build docker image to pull package from Nexus3 hosted NPM repository
docker build --tag $IMAGE_NAME:$IMAGE_TAG --build-arg NPM_EMAIL=$NPM_EMAIL --build-arg NPM_REPO_URL=$NPM_REPO_URL --build-arg NPM_RO_BASE64_STRING=$NPM_RO_BASE64_STRING .
  • Login and pull the demo container from Nexus3 hosted docker repository
docker login -u $DOCKER_RO_USER -p $DOCKER_RO_PW $DOCKER_URL

# use --rm to perform automatic container cleanup when container is stopped
docker run -d --rm -p $PORT:$PORT --name demo_express $DOCKER_URL/$IMAGE_NAME:$IMAGE_TAG

# Application can be access from the browser on http://localhost:$PORT

docker stop demo_express

Only available to Devops admins to populate new empty Nexus instance

####
source .env

npm conf set registry $NPM_REPO_URL && \
npm conf set email $NPM_EMAIL && \
npm conf set _auth $NPM_RW_BASE64_STRING

cat package.json.template |sed "s/NPM_PACKAGE_VERSION/${NPM_PACKAGE_VERSION}/" > package.json

npm publish

# Uses devops admin's person user token as NPM_RO_BASE64_STRING to test pulling packages
docker build --tag $IMAGE_NAME:$IMAGE_TAG --build-arg NPM_EMAIL=$NPM_EMAIL --build-arg NPM_REPO_URL=$NPM_REPO_URL --build-arg NPM_RO_BASE64_STRING=$NPM_RO_BASE64_STRING .

docker tag $IMAGE_NAME:$IMAGE_TAG $DOCKER_URL/$IMAGE_NAME:$IMAGE_TAG

docker login -u $DOCKER_RW_USER -p $DOCKER_RW_PW $DOCKER_URL

docker push $DOCKER_URL/$IMAGE_NAME:$IMAGE_TAG

#
# End Devops admin section
####

Quick all in one command for devops admins

. e2e_test.sh
0.0.9

1 year ago

0.0.63

2 years ago

0.0.62

2 years ago

0.0.57

2 years ago

0.0.56

2 years ago

0.0.55

2 years ago

0.0.54

2 years ago

0.0.53

2 years ago

0.0.52

2 years ago

0.0.51

2 years ago

0.0.50

2 years ago

0.0.49

2 years ago

0.0.48

2 years ago

0.0.47

2 years ago

0.0.46

2 years ago

0.0.43

2 years ago

0.0.42

2 years ago

0.0.41

2 years ago

0.0.40

2 years ago

0.0.39

2 years ago

0.0.38

2 years ago

0.0.37

2 years ago

0.0.36

2 years ago

0.0.35

2 years ago

0.0.34

2 years ago

0.0.33

2 years ago

0.0.32

2 years ago