aboutsummaryrefslogtreecommitdiffstats
path: root/build/external_resources/webpack/generate-webpack-resource.sh
blob: cba20981f3d85c36f70a097f66cf553b7ee492b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -e

WEBPACK_VERSION="5.69.1"
PACKAGES="webpack@$WEBPACK_VERSION webpack-cli@4.9.2 ts-loader@9.2.6 typescript@4.5.5"

cd ~

TMP_DIR="tmp"
if [[ ! -d $TMP_DIR ]]
then
    mkdir $TMP_DIR
fi
cd $TMP_DIR

WEBPACK_DIR="webpack-resource"
mkdir $WEBPACK_DIR && cd $WEBPACK_DIR

npm init -y

npm install --save-dev --save-exact --registry=https://npm.yandex-team.ru ${PACKAGES}
echo "Packages installed successfully"

RESOURCE_DIR="node_modules"
ARCHIVE="webpack-$WEBPACK_VERSION.tar.gz"
tar --create --gzip --file=$ARCHIVE $RESOURCE_DIR
echo "Created file $(pwd)/$ARCHIVE"

DESCR="Bundle for https://st.yandex-team.ru/FEI-24499. Content: ${PACKAGES}"
ya upload $ARCHIVE -d="${DESCR}" --ttl="inf" --attr="webpack=${WEBPACK_VERSION}"
echo "$ARCHIVE uploaded successfully"

echo "Cleanup…"
rm -fr ~/tmp/$WEBPACK_DIR

echo "Done."