converter/deploy.sh

45 lines
2.1 KiB
Bash
Raw Normal View History

2016-08-15 20:28:23 +02:00
#!/bin/sh
function die() {
echo $*
exit 1
}
2016-09-15 22:35:26 +02:00
declare destination
2016-08-15 20:28:23 +02:00
case "${TARGET}" in
"${WWW_DEPLOY_ROOT_DEVELOP}")
destination="${TARGET}/${CI_BUILD_REF_NAME}"
;;
"${WWW_DEPLOY_ROOT_STAGING}"|"${WWW_DEPLOY_ROOT_PRODUCTION}")
destination="${TARGET}"
;;
*)
die "Invalid TARGET specified. Aborting deployment."
2016-08-15 20:28:23 +02:00
;;
esac
if [[ ! -d "${destination}" ]] ; then
mkdir -p "${destination}" || die "Failed to create target directory for deployment!"
fi
2016-09-15 22:35:26 +02:00
rm -rf "${destination}"/* || die "Failed to clean destination directory (step 1)"
rm -rf "${destination}"/.??* || die "Failed to clean destination directory (step 2)"
cp -a dencode.css index.html package.json systemjs.config.js "${destination}" || die "Failed to copy resources to dest/"
mkdir -p "${destination}/app" || die "Failed to create dest/app directory"
cp -a app/*.css app/*.html app/*.js app/*.js.map "${destination}/app" || die "Failed to copy resources to dest/app"
mkdir -p "${destination}/node_modules/@angular" || die "Failed to create dest/node_modules/@angular"
2016-09-15 22:47:14 +02:00
cp -a node_modules/@angular/* "${destination}/node_modules/@angular/" || die "Failed to copy @angular"
mkdir -p "${destination}/node_modules/core-js/client" || die "Failed to create dest/node_modules/core-js"
cp -a node_modules/core-js/client/shim.js "${destination}/node_modules/core-js/client/" || die "Failed to copy core-js"
mkdir -p "${destination}/node_modules/zone.js/dist" || die "Failed to create dest/node_modules/zone.js"
cp -a node_modules/zone.js/dist/zone.js "${destination}/node_modules/zone.js/dist/" || die "Failed to copy zone.js"
mkdir -p "${destination}/node_modules/reflect-metadata" || die "Failed to create dest/node_modules/reflect-metadata"
cp -a node_modules/reflect-metadata/Reflect.js "${destination}/node_modules/reflect-metadata/" || die "Failed to copy Reflect.js"
mkdir -p "${destination}/node_modules/systemjs/dist" || die "Failed to create dest/node_modules/systemjs"
cp -a node_modules/systemjs/dist/system.src.js "${destination}/node_modules/systemjs/dist/" || die "Failed to copy system.src.js"
2016-08-15 20:28:23 +02:00
echo "Deployment successful."