Skip to content

Status Page Deployment and Migration Setup

Sudo Bro edited this page Aug 24, 2024 · 5 revisions

Status Page Deployment, Migration of HNG_Video_Suite and Monitoring of Infrastructure

  • Overview
  • Status Page Deployment for the Boilerplate
  • Migration of the HNG_Video_Suite to the New Server
  • Configuration of the application.properties File

Overview

This documentation provides a detailed account of the tasks performed to deploy a status page for our boilerplate project, migrate the HNG_Video_Suite application to a new server, and configure the application.properties file. Each task is crucial to ensuring the stability, performance, and seamless operation of our services.

Status Page Deployment for the Boilerplate

Objective:

To create and deploy a status page for monitoring the health and status of your boilerplate project. This page provides real-time insights into the system's operational status, ensuring we informed of any potential issues or downtime.

Setting up the .yaml file for deploying the status page

name: API Test and Status Update

on:
  schedule:
    - cron: "*/15 * * * *" 
  workflow_dispatch:

jobs:
  run-newman-tests:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Install Node.js
        uses: actions/setup-node@v3
        with:
          node-version: '20'

      - name: Install Newman
        run: npm install -g newman

      - name: Run Newman Collection
        run: |
          newman run "$NEW_COLLECTION_PATH" \
            --environment "$NEW_ENVIRONMENT_PATH" \
            --reporters json \
            --reporter-json-export "result.json"

        env:
          NEW_COLLECTION_PATH: ${{ secrets.NEWMAN_COLLECTION_PATH }}
          NEW_ENVIRONMENT_PATH: ${{ secrets.NEWMAN_ENVIRONMENT_PATH }}

      - name: Copy result.json to server
        uses: appleboy/[email protected]
        with:
          host: ${{ secrets.HOST }}
          username: ${{ secrets.USERNAME }}
          password: ${{ secrets.PASSWORD }}
          source: "result.json"
          target: "/home/${{ secrets.USERNAME }}/hng_boilerplate_java_web"

Migration of the HNG_Video_Suite to the New Server

Objective:

To move the HNG_Video_Suite application to a new server environment, ensuring minimal downtime and preserving data integrity.

Conversation

The HNG_Video_Suite application was successfully migrated to a new server to improve performance and scalability. The migration process began with setting up the new server environment, which included installing necessary software, configuring security measures, and ensuring the server was ready to host the application. Data migration followed, involving the transfer of databases, media files, and configuration files to the new server. The application configuration was updated, including environment variables and configuration files, to reflect the new server's settings. After Configuration was done, Thorough testing was conducted to ensure the application functioned correctly post-migration.

scp servername@ipaddress:/home/serveraname/repo /home/localmachine
scp -r repo servername@ipaddress:/home/servername

This process is to copy the repository from the server to my local machine then from my local machine back to the server

java

Configuration of the application.properties File

The application.properties file for the HNG_Video_Suite application was configured to align with the new server environment and also connected with aivide_be_java in the old server. This configuration included updating the database connection settings to point to the old server's database, setting the rabbitmq settings to avoid conflicts. The configuration process was crucial in ensuring that the application ran smoothly on the new server, maintaining its functionality and performance.