Update bar-assistant.sh
This commit is contained in:
		
							parent
							
								
									8f4be68b9f
								
							
						
					
					
						commit
						6f2e2d067e
					
				| @ -33,7 +33,7 @@ function update_script() { | ||||
|   RELEASE_BARASSISTANT=$(curl -fsSL https://api.github.com/repos/karlomikus/bar-assistant/releases/latest | jq -r '.tag_name') | ||||
|   RELEASE_SALTRIM=$(curl -fsSL https://api.github.com/repos/karlomikus/vue-salt-rim/releases/latest | jq -r '.tag_name') | ||||
| 
 | ||||
|   if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE_BARASSISTANT}" != "$(cat /opt/${APP}_version.txt)" ]]; then | ||||
|   if [[ "${RELEASE_BARASSISTANT}" != "$(cat ~/.bar-assistant 2>/dev/null)" ]] || [[ ! -f ~/.bar-assistant ]]; then | ||||
|     msg_info "Stopping nginx" | ||||
|     systemctl stop nginx | ||||
|     msg_ok "Stopped nginx" | ||||
| @ -44,7 +44,7 @@ function update_script() { | ||||
| 
 | ||||
|     fetch_and_deploy_gh_release "bar-assistant" "karlomikus/bar-assistant" "tarball" "latest" "/opt/bar-assistant" | ||||
| 
 | ||||
|     msg_info "Updating ${APP} to v${RELEASE_BARASSISTANT}" | ||||
|     msg_info "Updating ${APP} to ${RELEASE_BARASSISTANT}" | ||||
|     cp -r /opt/bar-assistant-backup/.env /opt/bar-assistant/.env | ||||
|     cp -r /opt/bar-assistant-backup/storage/bar-assistant /opt/bar-assistant/storage/bar-assistant | ||||
|     cd /opt/bar-assistant | ||||
| @ -57,7 +57,7 @@ function update_script() { | ||||
|     $STD php artisan route:cache | ||||
|     $STD php artisan event:cache | ||||
|     chown -R www-data:www-data /opt/bar-assistant | ||||
|     msg_ok "Updated $APP to v${RELEASE_BARASSISTANT}" | ||||
|     msg_ok "Updated $APP to ${RELEASE_BARASSISTANT}" | ||||
| 
 | ||||
|     msg_info "Starting nginx" | ||||
|     systemctl start nginx | ||||
| @ -67,10 +67,10 @@ function update_script() { | ||||
|     rm -rf /opt/bar-assistant-backup | ||||
|     msg_ok "Cleaned" | ||||
|   else | ||||
|     msg_ok "No update required. ${APP} is already at v${RELEASE_BARASSISTANT}" | ||||
|     msg_ok "No update required. ${APP} is already at ${RELEASE_BARASSISTANT}" | ||||
|   fi | ||||
| 
 | ||||
|   if [[ ! -f /opt/vue-salt-rim_version.txt ]] || [[ "${RELEASE_SALTRIM}" != "$(cat /opt/vue-salt-rim_version.txt)" ]]; then | ||||
|   if [[ "${RELEASE_SALTRIM}" != "$(cat ~/.vue-salt-rim 2>/dev/null)" ]] || [[ ! -f ~/.vue-salt-rim ]]; then | ||||
|     msg_info "Backing up Vue Salt Rim" | ||||
|     mv /opt/vue-salt-rim /opt/vue-salt-rim-backup | ||||
|     msg_ok "Backed up Vue Salt Rim" | ||||
| @ -81,12 +81,12 @@ function update_script() { | ||||
| 
 | ||||
|     fetch_and_deploy_gh_release "vue-salt-rim" "karlomikus/vue-salt-rim" "tarball" "latest" "/opt/vue-salt-rim" | ||||
| 
 | ||||
|     msg_info "Updating Salt Rim to v${RELEASE_SALTRIM}" | ||||
|     msg_info "Updating Salt Rim to ${RELEASE_SALTRIM}" | ||||
|     cp /opt/vue-salt-rim-backup/public/config.js /opt/vue-salt-rim/public/config.js | ||||
|     cd /opt/vue-salt-rim | ||||
|     $STD npm install | ||||
|     $STD npm run build | ||||
|     msg_ok "Updated $APP to v${RELEASE_SALTRIM}" | ||||
|     msg_ok "Updated $APP to ${RELEASE_SALTRIM}" | ||||
| 
 | ||||
|     msg_info "Starting nginx" | ||||
|     systemctl start nginx | ||||
| @ -97,10 +97,10 @@ function update_script() { | ||||
|     msg_ok "Cleaned" | ||||
|     msg_ok "Updated" | ||||
|   else | ||||
|     msg_ok "No update required. Salt Rim is already at v${RELEASE_SALTRIM}" | ||||
|     msg_ok "No update required. Salt Rim is already at ${RELEASE_SALTRIM}" | ||||
|   fi | ||||
| 
 | ||||
|   if [[ ! -f /opt/meilisearch_version.txt ]] || [[ "${RELEASE_MEILISEARCH}" != "$(cat /opt/meilisearch_version.txt)" ]]; then | ||||
|   if [[ "${RELEASE_MEILISEARCH}" != "$(cat ~/.meilisearch 2>/dev/null)" ]] || [[ ! -f ~/.meilisearch ]]; then | ||||
|     msg_info "Stopping Meilisearch" | ||||
|     systemctl stop meilisearch | ||||
|     msg_ok "Stopped Meilisearch" | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 CanbiZ
						CanbiZ