File vendorit-gitlab of Package container-vendor-gitlab-js
#!/usr/bin/bash
TARGET="$PWD/gitlab"
YARN_CACHE_SUBDIR="tmp/cache/yarn/"
mkdir -p $TARGET/
echo "Copy input files to work directory"
cd /work/gitlab/
rsync -a --delete-after $PWD/ $TARGET/
cd $TARGET
echo "Running yarn"
if yarn install --pure-lockfile --ignore-engines --cache-folder=$PWD/${YARN_CACHE_SUBDIR} ; then
echo "Cleaning up *.node files"
# find -name \*.node -print -delete ;
find -name \*.node -path '*obj.target*' -delete -ls
echo "Compressing files"
pushd workhorse
go mod vendor
popd
ls /work/
bsdtar --option xz:threads=16 -cJf /work/gitlab-js-stuff.tar.xz ${YARN_CACHE_SUBDIR} node_modules/ workhorse/go.mod workhorse/go.sum workhorse/vendor/ ;
# bsdtar --option xz:threads=16 -cJf /work/gitlab-js-stuff.tar.xz workhorse/go.mod workhorse/go.sum workhorse/vendor/ ;
else
echo "yarn failed" ;
exit 1
fi