File vendorit-discourse of Package container-vendor-gitlab-js
#!/usr/bin/bash
set -x
export LC_ALL=en_US.UTF-8
export LANG="${LC_ALL}"
export LANGUAGE="${LC_ALL}"
TARGET="$PWD/discourse"
mkdir -p $TARGET/
echo "Copy input files to work directory"
cd /work/discourse/
rsync -a $PWD/ $TARGET/
cd $TARGET
vendor_cache_dir="vendor/cache/pnpm/"
if pnpm install --store-dir "${vendor_cache_dir}" ; then
find -type f \( -name \*.md -o -name \*.txt -o -name \*.ts -o -name \*.js* -o -name LICENSE -o -name \*.map -o -name \*.css \) -executable -print0 | xargs -r0 chmod a-x
find \( -name \*~ -o -name \*.bak \) -print -delete ;
rm -rv \
node_modules/.pnpm/@swc+core-linux-x64-musl@* \
node_modules/.pnpm/node_modules/@swc/core-linux-x64-musl \
node_modules/.pnpm/@swc+core@*/node_modules/@swc/core-linux-x64-musl \
node_modules/.pnpm/rollup@4.44.0/node_modules/@rollup/rollup-linux-x64-musl \
node_modules/.pnpm/node_modules/@rollup/rollup-linux-x64-musl \
node_modules/.pnpm/@rollup+rollup-linux-x64-musl@* \
node_modules/.pnpm/bare-*@*/node_modules/bare-*/prebuilds/ios* \
node_modules/.pnpm/bare-*@*/node_modules/bare-*/prebuilds/win* \
node_modules/.pnpm/bare-*@*/node_modules/bare-*/prebuilds/darwin* \
node_modules/.pnpm/bare-*@*/node_modules/bare-*/prebuilds/android* \
node_modules/.pnpm/bare-*@*/node_modules/bare-*/prebuilds/linux-arm64
echo "Fetching git deps"
vendor_gems_dir="vendor/gems"
git_cmdline="git clone --quiet --no-tags --single-branch"
mkdir -p "${vendor_gems_dir}"
pushd "${vendor_gems_dir}"
${git_cmdline} -- https://github.com/nlalonde/ruby-bbcode-to-md "ruby-bbcode-to-md"
popd
# echo "Compressing files"
bsdtar -cJf /work/vendor.tar.xz \
"${vendor_gems_dir}" \
"${vendor_cache_dir}" \
app/assets/javascripts/*/node_modules/ \
node_modules/
else
echo "pnpm failed" ;
exit 1
fi