34 lines
1 KiB
Bash
34 lines
1 KiB
Bash
#!/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
|
|
|
|
if [[ ! -d "${destination}" ]] ; then
|
|
mkdir -p "${destination}" || echo "Failed to create target directory for deployment!"
|
|
fi
|
|
|
|
rm -rf "${destination}/*"
|
|
rm -rf "${destination}/.??*"
|
|
|
|
cp -a dencode.css index.html package.json systemjs.config.js "${destination}"
|
|
|
|
mkdir "${destination}/app"
|
|
cp -a app/*.css app/*.html app/*.js app/*.js.map "${destination}/app"
|
|
|
|
mkdir -p "${destination}/node_modules/{core-js/client,zone.js/dist,reflect-metadata,systemjs/dist}"
|
|
cp -a node_modules/core-js/client/shim.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"
|
|
|
|
echo "Deployment successful."
|