Skip to content

Commit

Permalink
doc: local testing
Browse files Browse the repository at this point in the history
  • Loading branch information
xtuc committed Apr 15, 2022
1 parent 1309ae2 commit e448458
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
17 changes: 15 additions & 2 deletions scripts/test-process-version.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e448458

Please sign in to comment.