2016-08-15 20:28:23 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-09-15 22:31:08 +02:00
|
|
|
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}"
|
|
|
|
;;
|
|
|
|
*)
|
2016-09-15 22:31:08 +02:00
|
|
|
die "Invalid TARGET specified. Aborting deployment."
|
2016-08-15 20:28:23 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2016-08-15 20:37:48 +02:00
|
|
|
if [[ ! -d "${destination}" ]] ; then
|
2016-09-15 22:31:08 +02:00
|
|
|
mkdir -p "${destination}" || die "Failed to create target directory for deployment!"
|
2016-08-15 20:37:48 +02:00
|
|
|
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)"
|
2016-09-15 21:32:14 +02:00
|
|
|
|
2016-09-21 03:04:58 +02:00
|
|
|
cp -a index.html abeezee-regular.woff freemono.* package.json systemjs.config.js "${destination}" || die "Failed to copy resources to dest/"
|
2016-09-15 21:32:14 +02:00
|
|
|
|
2016-09-21 02:58:11 +02:00
|
|
|
mkdir -p "${destination}/app/converter" || die "Failed to create dest/app/converter directory"
|
2016-09-15 22:31:08 +02:00
|
|
|
cp -a app/*.css app/*.html app/*.js app/*.js.map "${destination}/app" || die "Failed to copy resources to dest/app"
|
2016-09-21 02:58:11 +02:00
|
|
|
cp -a app/converter/*.js app/converter/*.js.map "${destination}/app/converter" || die "Failed to copy resources to dest/app/converter"
|
2016-09-15 21:32:14 +02:00
|
|
|
|
2016-09-15 23:35:55 +02:00
|
|
|
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"
|
2016-09-21 03:04:58 +02:00
|
|
|
|
2016-09-15 23:35:55 +02:00
|
|
|
mkdir -p "${destination}/node_modules/core-js/client" || die "Failed to create dest/node_modules/core-js"
|
2016-09-15 22:31:08 +02:00
|
|
|
cp -a node_modules/core-js/client/shim.js "${destination}/node_modules/core-js/client/" || die "Failed to copy core-js"
|
2016-09-21 03:04:58 +02:00
|
|
|
|
2016-09-15 23:35:55 +02:00
|
|
|
mkdir -p "${destination}/node_modules/zone.js/dist" || die "Failed to create dest/node_modules/zone.js"
|
2016-09-15 22:31:08 +02:00
|
|
|
cp -a node_modules/zone.js/dist/zone.js "${destination}/node_modules/zone.js/dist/" || die "Failed to copy zone.js"
|
2016-09-21 03:04:58 +02:00
|
|
|
|
2016-09-15 23:35:55 +02:00
|
|
|
mkdir -p "${destination}/node_modules/reflect-metadata" || die "Failed to create dest/node_modules/reflect-metadata"
|
2016-09-15 22:31:08 +02:00
|
|
|
cp -a node_modules/reflect-metadata/Reflect.js "${destination}/node_modules/reflect-metadata/" || die "Failed to copy Reflect.js"
|
2016-09-21 03:04:58 +02:00
|
|
|
|
2016-09-21 02:51:41 +02:00
|
|
|
mkdir -p "${destination}/node_modules/rxjs" || die "Failed to create dest/node_modules/rxjs"
|
|
|
|
cp -a node_modules/rxjs/* "${destination}/node_modules/rxjs/" || die "Failed to copy rxjs"
|
2016-09-21 03:04:58 +02:00
|
|
|
|
2016-09-15 23:35:55 +02:00
|
|
|
mkdir -p "${destination}/node_modules/systemjs/dist" || die "Failed to create dest/node_modules/systemjs"
|
2016-09-15 22:31:08 +02:00
|
|
|
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
|
|
|
|
2016-09-21 03:04:58 +02:00
|
|
|
mkdir -p "${destination}/node_modules/utf8" || die "Failed to create dest/node_modules/utf8"
|
|
|
|
cp -a node_modules/utf8/utf8.js "${destination}/node_modules/utf8/" || die "Failed to copy utf8.js"
|
|
|
|
|
|
|
|
mkdir -p "${destination}/node_modules/quoted-printable" || die "Failed to create dest/node_modules/quoted-printable"
|
|
|
|
cp -a node_modules/quoted-printable/quoted-printable.js "${destination}/node_modules/quoted-printable/" || die "Failed to copy quoted-printable.js"
|
|
|
|
|
2016-08-15 20:28:23 +02:00
|
|
|
echo "Deployment successful."
|