diff --git a/doc/PRODUCTION.md b/doc/PRODUCTION.md index 170759d..7b82741 100644 --- a/doc/PRODUCTION.md +++ b/doc/PRODUCTION.md @@ -16,7 +16,7 @@ cd ERPLibre ### 2. Modify the parameters Modify the file env_var.sh for production installation. Enable nginx if you need a proxy with `EL_INSTALL_NGINX` at -True. Redirect your DNS to the proxy's ip and add your A and AAAA into `WL_WEBSITE_NAME` with space between. +True. Redirect your DNS to the proxy's ip and add your A and AAAA into `EL_WEBSITE_NAME` with space between. ### 3. Execute the scripts: diff --git a/script/install_production.sh b/script/install_production.sh index 8f3d73e..2eba28a 100755 --- a/script/install_production.sh +++ b/script/install_production.sh @@ -24,7 +24,12 @@ sudo chown -R ${EL_USER}:${EL_USER} ${EL_HOME} echo -e "\n==== Clone this installation ====" REMOTE_URL_GIT=`git remote get-url origin` BRANCH_GIT=`git rev-parse --abbrev-ref HEAD` -sudo su ${EL_USER} -c "git clone --branch ${BRANCH_GIT} ${REMOTE_URL_GIT} ${EL_HOME_ERPLIBRE}" +if [ "HEAD" = "${BRANCH_GIT}" ]; then + # Checkout version of env_var.sh + sudo su ${EL_USER} -c "git clone --branch v${ERPLIBRE_VERSION} ${REMOTE_URL_GIT} ${EL_HOME_ERPLIBRE}" +else + sudo su ${EL_USER} -c "git clone --branch ${BRANCH_GIT} ${REMOTE_URL_GIT} ${EL_HOME_ERPLIBRE}" +fi sudo cp ./env_var.sh ${EL_HOME_ERPLIBRE} sudo chown -R ${EL_USER}:${EL_USER} ${EL_HOME_ERPLIBRE}/env_var.sh