hopefully added enought debug stuff to diagnose the source of the deploy

error
This commit is contained in:
Manuel Friedli 2016-09-15 22:31:08 +02:00
parent 11f098d18e
commit 1608a354cf

View file

@ -1,6 +1,11 @@
#!/bin/sh #!/bin/sh
declare destination function die() {
echo $*
exit 1
}
}declare destination
case "${TARGET}" in case "${TARGET}" in
"${WWW_DEPLOY_ROOT_DEVELOP}") "${WWW_DEPLOY_ROOT_DEVELOP}")
destination="${TARGET}/${CI_BUILD_REF_NAME}" destination="${TARGET}/${CI_BUILD_REF_NAME}"
@ -9,33 +14,32 @@ case "${TARGET}" in
destination="${TARGET}" destination="${TARGET}"
;; ;;
*) *)
echo "Invalid TARGET specified. Aborting deployment." die "Invalid TARGET specified. Aborting deployment."
exit 1
;; ;;
esac esac
if [[ ! -d "${destination}" ]] ; then if [[ ! -d "${destination}" ]] ; then
mkdir -p "${destination}" || echo "Failed to create target directory for deployment!" mkdir -p "${destination}" || die "Failed to create target directory for deployment!"
fi fi
echo "Before any deletion:" echo "Before any deletion:"
ls "${destination}" ls "${destination}"
rm -rf "${destination}/*" rm -rf "${destination}/*" || die "Failed to clean destination directory (step 1)"
echo "After rm -rf dest/*:" echo "After rm -rf dest/*:"
ls "${destination}" ls "${destination}"
rm -rf "${destination}/.??*" rm -rf "${destination}/.??*" || die "Failed to clean destination directory (step 2)"
echo "After rm -rf dest/.??:" echo "After rm -rf dest/.??:"
ls "${destination}" ls "${destination}"
cp -a dencode.css index.html package.json systemjs.config.js "${destination}" cp -a dencode.css index.html package.json systemjs.config.js "${destination}" || die "Failed to copy resources to dest/"
mkdir -p "${destination}/app" mkdir -p "${destination}/app" || die "Failed to create dest/app directory"
cp -a app/*.css app/*.html app/*.js app/*.js.map "${destination}/app" 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/core-js/client" "${destination}node_modules/zone.js/dist" "${destination}/node_modules/reflect-metadata" "${destination}/node_modules/systemjs/dist" mkdir -p "${destination}/node_modules/core-js/client" "${destination}node_modules/zone.js/dist" "${destination}/node_modules/reflect-metadata" "${destination}/node_modules/systemjs/dist" || die "Failed to create dest/node_modules/* directories"
cp -a node_modules/core-js/client/shim.js "${destination}/node_modules/core-js/client/" cp -a node_modules/core-js/client/shim.js "${destination}/node_modules/core-js/client/" || die "Failed to copy core-js"
cp -a node_modules/zone.js/dist/zone.js "${destination}/node_modules/zone.js/dist/" cp -a node_modules/zone.js/dist/zone.js "${destination}/node_modules/zone.js/dist/" || die "Failed to copy zone.js"
cp -a node_modules/reflect-metadata/Reflect.js "${destination}/node_modules/reflect-metadata/" cp -a node_modules/reflect-metadata/Reflect.js "${destination}/node_modules/reflect-metadata/" || die "Failed to copy Reflect.js"
cp -a node_modules/systemjs/dist/system.src.js "${destination}/node_modules/systemjs/dist/" cp -a node_modules/systemjs/dist/system.src.js "${destination}/node_modules/systemjs/dist/" || die "Failed to copy system.src.js"
echo "Deployment successful." echo "Deployment successful."