2020-06-12 04:00:01 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
2020-11-16 21:57:09 +00:00
|
|
|
for appdir in `find ./apps -name '*-app' -type d | grep -v node_modules`; do
|
2020-06-12 04:00:01 +00:00
|
|
|
pushd $appdir
|
|
|
|
|
2020-11-16 21:57:09 +00:00
|
|
|
WNS_ORG="${WNS_ORG:-dxos}"
|
|
|
|
PKG_CHANNEL="${PKG_CHANNEL:-}"
|
2020-08-27 18:23:32 +00:00
|
|
|
PKG_NAME=`cat package.json | jq -r '.name' | cut -d'/' -f2- | sed 's/-app$//'`
|
2020-08-27 18:08:19 +00:00
|
|
|
WNS_NAME="$WNS_ORG/$PKG_NAME"
|
2020-06-12 04:00:01 +00:00
|
|
|
|
|
|
|
cat <<EOF > app.yml
|
2020-08-27 18:08:19 +00:00
|
|
|
name: $PKG_NAME
|
2020-06-12 04:00:01 +00:00
|
|
|
build: yarn dist
|
|
|
|
EOF
|
2020-11-16 21:57:09 +00:00
|
|
|
|
|
|
|
cat app.yml
|
|
|
|
echo "wrn://${WNS_ORG}/application/${PKG_NAME}${PKG_CHANNEL}"
|
|
|
|
|
2020-06-13 04:30:50 +00:00
|
|
|
yarn clean
|
2020-11-16 20:11:34 +00:00
|
|
|
yarn -s wire app build
|
2020-06-13 04:30:50 +00:00
|
|
|
|
2020-06-12 04:00:01 +00:00
|
|
|
if [ -d "dist/production" ]; then
|
|
|
|
yarn -s wire app publish --path './dist/production'
|
|
|
|
else
|
|
|
|
yarn -s wire app publish
|
|
|
|
fi
|
|
|
|
|
2020-11-16 21:57:09 +00:00
|
|
|
yarn -s wire app register --name "wrn://${WNS_ORG}/application/${PKG_NAME}${PKG_CHANNEL}"
|
2020-06-12 04:00:01 +00:00
|
|
|
popd
|
|
|
|
done
|