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-08-15 20:28:23 +02:00
|
|
|
rm -rf "${destination}/*"
|
|
|
|
rm -rf "${destination}/.??*"
|
|
|
|
cp -a dencode.css dencode.js index.html quoted-printable.js utf8.js "${destination}"
|
|
|
|
|
|
|
|
echo "Deployment successful."
|