1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #!/bin/bash
- #
- # publish-parts - Publish parts of a product
- #
- function publishParts() {
- unset CDPATH
- local PARTS="api, app, ui, web"
- while [[ $# -gt 0 ]] ; do
- arg="$1"
- case ${arg} in
- --parts)
- PARTS="${2}"
- shift ; shift
- ;;
- *)
- break
- ;;
- esac
- done
- PARTS=$(echo ${PARTS} | tr ',' ' ')
- for part in ${PARTS} ; do
- [ ! -d "${part}" ] && continue
- local files=""
- for f in CONFIG/keys.json ${part}/CONFIG/keys.json ${part}/product.json pak.json ; do
- [ -f ${f} ] && files="${files} ${f}"
- done
- eval $(paks/assist/json2env ${files})
- cd "./${part}"
- echo -e "\nPublish ${part} $*"
- if [ -f bin/publish ] ; then
- ./bin/publish $*
- elif [ -f gulpfile.ts ] ; then
- gulp publish $*
- elif [ -f main.me ] ; then
- me publish
- elif [ -f Makefile ] ; then
- make publish
- fi
- [ $? != 0 ] && exit 2
- cd ..
- done
- }
- publishParts $*
|