Skip to content

Deploying RiskProfiler

Anthony Fok edited this page Jun 19, 2023 · 4 revisions

Table of Content

Overview of Git Repositories

HabitatSeven (private repos):

OpenDRR, Geological Survey of Canada (public repos):

Overall Workflow

(Please right-click and select “Open link in new tab” to follow the links. Using the middle mouse button may also work. The usual Ctrl+Click or Command+Click keyboard shortcut may not work.)

flowchart TD
    A[Start] --> AskH7[Ask H7 to provide latest code and database]
    AskH7 --> GH-pe-h7rp["Check <a href='https://github.com/phil-evans/h7-riskprofiler'>phil-evans/h7-riskprofiler</a>"]
    AskH7 --> GetDB[Get WP database export from H7]

    GH-pe-h7rp --> GH-h7rp["Check <a href='https://github.com/OpenDRR/h7-riskprofiler'>OpenDRR/h7-riskprofiler</a>"]

    subgraph Synchronize OpenDRR/h7-riskprofiler
        GH-h7rp --> GH-h7rp-in-sync{In sync?}
    
        GH-h7rp-in-sync -- No --> GH-sync-h7rp["Run <a href='https://github.com/OpenDRR/h7-riskprofiler/actions/workflows/sync.yml'>“Sync with H7” workflow</a><br/>(GitHub Actions) manually"]
    
        GH-sync-h7rp --> GH-sync-h7rp-succeed{Succeed?}
        GH-sync-h7rp-succeed -- No --> GH-h7rp-conflict["Check <a href='https://github.com/OpenDRR/h7-riskprofiler/actions/workflows/sync.yml'>GitHub Actions log</a>,<br/>Resolve merge conflict<br/>where necessary."]
    end

    subgraph Synchronize OpenDRR/riskprofiler
        GH-h7rp-in-sync -- Yes --> GH-rp["Check <a href='https://github.com/OpenDRR/riskprofiler'>OpenDRR/riskprofiler</a>"]
        GH-sync-h7rp-succeed -- Yes --> GH-rp
        GH-h7rp-conflict --> GH-rp

        GH-rp --> GH-rp-in-sync{In sync?}
        GH-rp-in-sync -- No --> GH-sync-rp["Run <a href='https://github.com/OpenDRR/riskprofiler/actions/workflows/sync.yml'>“Sync with H7” workflow</a><br/>(GitHub Actions) manually"]
    
        GH-sync-rp --> GH-sync-rp-succeed{Succeed?}
        GH-sync-rp-succeed -- No --> GH-rp-conflict["Check <a href='https://github.com/OpenDRR/riskprofiler/actions/workflows/sync.yml'>GitHub Actions logs</a>,<br/>and resolve merge conflict<br/>where necessary"]
    end

    GetDB --> SanitizeDB["<a href='https://github.com/OpenDRR/confidential/wiki/Sanitizing-RiskProfiler-WordPress-database'>“Sanitize” database</a>"]
    subgraph Prepare database
        SanitizeDB --> SaveDB["Save as<br>db-backup/riskprofiler_db.sql<br/>in your local<br/><a href='https://github.com/OpenDRR/riskprofiler'>OpenDRR/riskprofiler</a><br/>repository"]
        SaveDB --> CommitDB[Commit to Git]
        CommitDB --> PushDB[Push to GitHub]
    end

    GH-sync-rp-succeed -- Yes --> ExportStaticSite["Run “<a href='https://github.com/OpenDRR/riskprofiler/actions/workflows/export-static-site.yml'>Export static site for RiskProfiler.ca</a>”<br>workflow (GitHub Actions) manually"]
    GH-rp-in-sync -- Yes --> ExportStaticSite
    GH-rp-conflict --> ExportStaticSite
    PushDB --------> ExportStaticSite

    ExportStaticSite --> CheckGHPages["Check result on <a href='https://opendrr.github.io/riskprofiler/'>https://opendrr.github.io/riskprofiler/</a>"]

    %% CheckGHPages --> Releasable{Ready for<br>release?}
    %% Releasable -- Yes --> CreateRelease["<a href='https://github.com/OpenDRR/riskprofiler/releases/new'>Create release on GitHub</a>"]
    %% Releasable -- No --> End

    CheckGHPages -->CreateRelease["<a href='https://github.com/OpenDRR/riskprofiler/releases/new'>Create release on GitHub</a>"]

    subgraph Release
        CreateRelease --> DownloadAssets["<a href='https://github.com/OpenDRR/riskprofiler/releases'>Download release tarball or ZIP file</a>"]
        DownloadAssets --> ExtractZIP[Extract ZIP or tarball]
        ExtractZIP --> DeployToAWS[Deploy to AWS]
    end

    DeployToAWS --> End


    %% Unfortunately, "click" does not work on GitHub wiki,
    %% see https://github.com/orgs/community/discussions/46096

    %% click GH-pe-h7rp "https://github.com/phil-evans/h7-riskprofiler" "Open phil-evans/h7-riskprofiler in a new tab" _blank
    %% click GH-h7rp "https://github.com/OpenDRR/h7-riskprofiler" "Open OpenDRR/h7-riskprofiler in a new tab" _blank

    %% click GH-sync-h7rp "https://github.com/OpenDRR/h7-riskprofiler/actions/workflows/sync.yml" _blank
    %% click GH-sync-rp "https://github.com/OpenDRR/riskprofiler/actions/workflows/sync.yml" _blank

    %% click ExportStaticSite "https://github.com/OpenDRR/riskprofiler/actions/workflows/export-static-site.yml" _blank
    %% click CheckGHPages "https://opendrr.github.io/riskprofiler/" _blank

    %% click CreateRelease "https://github.com/OpenDRR/riskprofiler/releases/new" _blank
Loading

More details

Synchronization with HabitatSeven codebase

More information on Testing and Deployment

See also Procedure to update RiskProfiler website. (Sorry, probably too much detail; still in draft, to be updated, not yet public as of June 2023.)

Clone this wiki locally