generate-webpack-resource.sh 837 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. set -e
  3. WEBPACK_VERSION="5.69.1"
  4. PACKAGES="webpack@$WEBPACK_VERSION webpack-cli@4.9.2 ts-loader@9.2.6 typescript@4.5.5"
  5. cd ~
  6. TMP_DIR="tmp"
  7. if [[ ! -d $TMP_DIR ]]
  8. then
  9. mkdir $TMP_DIR
  10. fi
  11. cd $TMP_DIR
  12. WEBPACK_DIR="webpack-resource"
  13. mkdir $WEBPACK_DIR && cd $WEBPACK_DIR
  14. npm init -y
  15. npm install --save-dev --save-exact --registry=https://npm.yandex-team.ru ${PACKAGES}
  16. echo "Packages installed successfully"
  17. RESOURCE_DIR="node_modules"
  18. ARCHIVE="webpack-$WEBPACK_VERSION.tar.gz"
  19. tar --create --gzip --file=$ARCHIVE $RESOURCE_DIR
  20. echo "Created file $(pwd)/$ARCHIVE"
  21. DESCR="Bundle for https://st.yandex-team.ru/FEI-24499. Content: ${PACKAGES}"
  22. ya upload $ARCHIVE -d="${DESCR}" --ttl="inf" --attr="webpack=${WEBPACK_VERSION}"
  23. echo "$ARCHIVE uploaded successfully"
  24. echo "Cleanup…"
  25. rm -fr ~/tmp/$WEBPACK_DIR
  26. echo "Done."