2016-06-26 22:20:30 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-06-27 01:10:08 +02:00
|
|
|
declare destination
|
2016-06-27 00:58:36 +02:00
|
|
|
case "${TARGET}" in
|
|
|
|
"${WWW_DEPLOY_ROOT_DEVELOP}")
|
2016-06-27 01:10:08 +02:00
|
|
|
destination="${TARGET}/${CI_BUILD_REF_NAME}"
|
2016-06-27 00:58:36 +02:00
|
|
|
;;
|
2016-06-27 01:10:08 +02:00
|
|
|
"${WWW_DEPLOY_ROOT_STAGING}"|"${WWW_DEPLOY_ROOT_PRODUCTION}")
|
|
|
|
destination="${TARGET}"
|
2016-06-27 00:58:36 +02:00
|
|
|
;;
|
|
|
|
*)
|
2016-06-27 01:10:08 +02:00
|
|
|
echo "Invalid TARGET specified. Aborting deployment."
|
|
|
|
exit 1
|
2016-06-27 00:58:36 +02:00
|
|
|
;;
|
|
|
|
esac
|
2016-06-27 01:10:08 +02:00
|
|
|
|
|
|
|
rm -rf "${destination}/*"
|
2016-06-27 01:12:12 +02:00
|
|
|
rm -rf "${destination}/.??*"
|
2016-06-27 01:10:08 +02:00
|
|
|
mkdir -p "${destination}/dist"
|
|
|
|
cp -a index.html manifest.appcache info resources "${destination}"
|
|
|
|
cp -a dist/*.min.* "${destination}/dist"
|
|
|
|
|
|
|
|
echo "Deployment successful."
|