Fix build script to first clean the old files from the production environment.

This commit is contained in:
Manuel Friedli 2017-11-08 01:39:14 +01:00
parent bf2212255e
commit c38a07d1e4

View file

@ -68,6 +68,7 @@ production:
script:
- if [[ -z "${WWW_DEPLOY_ROOT_PRODUCTION}" ]] ; then echo "WWW_DEPLOY_ROOT_PRODUCTION is not set" ; exit 1 ; fi
- if [[ ! -d "${WWW_DEPLOY_ROOT_PRODUCTION}" ]] ; then mkdir -p "${WWW_DEPLOY_ROOT_PRODUCTION}" || die "Failed to create target directory for deployment!" ; fi
- rm -rf "${WWW_DEPLOY_ROOT_PRODUCTION}"/* || die "Failed to clean old deployment"
- cp -r dist/* "${WWW_DEPLOY_ROOT_PRODUCTION}"
cleanup_job: