making progress: the deploy script seems somewhat useful now.

This commit is contained in:
Manuel Friedli 2016-06-27 01:10:08 +02:00
parent 1163a6e357
commit f6a24858d0

View file

@ -1,38 +1,23 @@
#!/bin/sh #!/bin/sh
echo "Target: ${ENVIRON}" declare destination
if [ "develop" == "${ENVIRON}" ] ; then
echo "Deploying ${CI_BUILD_REF_NAME} to develop. You can access it at .../${CI_BUILD_REF_NAME}"
target="${WWW_DEPLOY_ROOT_DEVELOP}/${CI_BUILD_REF_NAME}"
rm -rf "${target}"
mkdir -p "${target}/dist"
cp -a index.html manifest.appcache info resources "${target}"
cp -a dist/*.min.* "${target}/dist"
else
echo "Automatic deployment to ${ENVIRON} is not yet implemented."
fi
if [ "${WWW_DEPLOY_ROOT_DEVELOP}" == "${TARGET}" ] ; then
echo "Deployment to develop requested"
elif [ "${WWW_DEPLOY_ROOT_STAGING}" == "${TARGET}" ] ; then
echo "Deployment to staging requested"
elif [ "${WWW_DEPLOY_ROOT_PRODUCTION}" == "${TARGET}" ] ; then
echo "Deployment to PRODUCTION requested"
else
echo "Unknown environment: ${TARGET}"
fi
case "${TARGET}" in case "${TARGET}" in
"${WWW_DEPLOY_ROOT_DEVELOP}") "${WWW_DEPLOY_ROOT_DEVELOP}")
echo "DepToDev" destination="${TARGET}/${CI_BUILD_REF_NAME}"
;; ;;
"${WWW_DEPLOY_ROOT_STAGING}") "${WWW_DEPLOY_ROOT_STAGING}"|"${WWW_DEPLOY_ROOT_PRODUCTION}")
echo "DepToSta" destination="${TARGET}"
;;
"${WWW_DEPLOY_ROOT_PRODUCTION}")
echo "DepToPro"
;; ;;
*) *)
echo "DevToFOO" echo "Invalid TARGET specified. Aborting deployment."
exit 1
;; ;;
esac esac
echo "Dest: '${destination}'"
rm -rf "${destination}/*"
mkdir -p "${destination}/dist"
cp -a index.html manifest.appcache info resources "${destination}"
cp -a dist/*.min.* "${destination}/dist"
echo "Deployment successful."