2016-08-15 20:28:23 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
declare destination
|
|
|
|
case "${TARGET}" in
|
|
|
|
"${WWW_DEPLOY_ROOT_DEVELOP}")
|
|
|
|
destination="${TARGET}/${CI_BUILD_REF_NAME}"
|
|
|
|
;;
|
|
|
|
"${WWW_DEPLOY_ROOT_STAGING}"|"${WWW_DEPLOY_ROOT_PRODUCTION}")
|
|
|
|
destination="${TARGET}"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Invalid TARGET specified. Aborting deployment."
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2016-08-15 20:37:48 +02:00
|
|
|
if [[ ! -d "${destination}" ]] ; then
|
|
|
|
mkdir -p "${destination}" || echo "Failed to create target directory for deployment!"
|
|
|
|
fi
|
|
|
|
|
2016-09-15 22:22:45 +02:00
|
|
|
echo "Before any deletion:"
|
|
|
|
ls "${destination}"
|
2016-08-15 20:28:23 +02:00
|
|
|
rm -rf "${destination}/*"
|
2016-09-15 22:22:45 +02:00
|
|
|
echo "After rm -rf dest/*:"
|
|
|
|
ls "${destination}"
|
2016-08-15 20:28:23 +02:00
|
|
|
rm -rf "${destination}/.??*"
|
2016-09-15 22:22:45 +02:00
|
|
|
echo "After rm -rf dest/.??:"
|
|
|
|
ls "${destination}"
|
2016-09-15 21:32:14 +02:00
|
|
|
|
|
|
|
cp -a dencode.css index.html package.json systemjs.config.js "${destination}"
|
|
|
|
|
2016-09-15 22:14:17 +02:00
|
|
|
mkdir -p "${destination}/app"
|
2016-09-15 21:32:14 +02:00
|
|
|
cp -a app/*.css app/*.html app/*.js app/*.js.map "${destination}/app"
|
|
|
|
|
2016-09-15 22:14:17 +02:00
|
|
|
mkdir -p "${destination}/node_modules/core-js/client" "${destination}node_modules/zone.js/dist" "${destination}/node_modules/reflect-metadata" "${destination}/node_modules/systemjs/dist"
|
2016-09-15 22:22:45 +02:00
|
|
|
cp -a node_modules/core-js/client/shim.js "${destination}/node_modules/core-js/client/"
|
|
|
|
cp -a node_modules/zone.js/dist/zone.js "${destination}/node_modules/zone.js/dist/"
|
|
|
|
cp -a node_modules/reflect-metadata/Reflect.js "${destination}/node_modules/reflect-metadata/"
|
|
|
|
cp -a node_modules/systemjs/dist/system.src.js "${destination}/node_modules/systemjs/dist/"
|
2016-08-15 20:28:23 +02:00
|
|
|
|
|
|
|
echo "Deployment successful."
|