25 lines
611 B
Bash
25 lines
611 B
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 dencode.js index.html quoted-printable.js utf8.js "${destination}"
|
|
|
|
echo "Deployment successful."
|