diff --git a/README.md b/README.md index fa77f5e..78f9fa6 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,12 @@ In `tools/` run `npm install`. - [zopflipng](https://github.com/google/zopfli) - [brotli](https://github.com/google/brotli) (Linux) +## Run update locally + +``` +bash ./scripts/test-process-version.sh package-name package-version +``` + ## License Each library hosted on cdnjs is released under its own license. This cdnjs repository is published under [MIT license](LICENSE). diff --git a/scripts/test-process-version.sh b/scripts/test-process-version.sh index f3a477b..f3fd002 100644 --- a/scripts/test-process-version.sh +++ b/scripts/test-process-version.sh @@ -1,14 +1,27 @@ +package=$1 +version=$2 + +set -e + +echo "processing $package $version" + export DOCKER_BUILDKIT=1 mkdir -p /tmp/input /tmp/output rm -rf /tmp/output/* -curl https://storage.googleapis.com/cdnjs-incoming-prod/design-system-2.15.4.tgz > /tmp/input/new-version.tgz -curl https://raw.githubusercontent.com/cdnjs/packages/master/packages/d/design-system.json > /tmp/input/config.json +echo "loading new version files" +curl --fail https://storage.googleapis.com/cdnjs-incoming-prod/$package-$version.tgz > /tmp/input/new-version.tgz +echo "loading package configuration" +curl --fail https://raw.githubusercontent.com/cdnjs/packages/master/packages/${package::1}/$package.json > /tmp/input/config.json + +cat /tmp/input/config.json +echo "----------------- input files -----------------" ls -lh /tmp/input docker build -f docker/process-version/Dockerfile -t sandbox . docker run -it -v /tmp/input:/input -v /tmp/output:/output sandbox +echo "----------------- output files -----------------" ls -lh /tmp/output