HS Overrides Setup

Overview:  The instructions below consist of two parts.  Part I is done only once and is performed to create your git clone and push your initial files to your repository.  Part II is done to periodically update files in your GIT repository.  While there are quite a few commands, eventually you will blow through these quickly. It is important to follow the commands in order.   Before completing part I, users will need to be added to a member list in order to push content.  Please follow PRE-INSTALL STEPS A-C. Then email the specified list and wait to proceed until your request was acknowledged.  


ONE TIME SETUP


A) PRE-INSTALL: FIRST TIME USER OF Gerrit Code Review

  • NOTE: If you haven’t logged into Gerrit Code Review, then log in with your ICAM LDAD credentials.  You only have to do this one time.   (If you don’t know if you have logged in, then log in below)

 

B) PRE-INSTALL: EMAIL the following list of people to have your name added to a member list. 

  • To be able to push content to your sites branch, your name needs to be added to an integrators list.   

  • This procedure only has to be done once.  

 

C) PRE-INSTALL: Wait until you receive an email back acknowledging your request. 

  • Once you receive an email notifying you that you have been added to the list, proceed.  

  • You will NOT have to complete these steps again. 

 


Part I - Initial Setup in AWIPS - ONLY DONE THE FIRST TIME


Note:  Run the commands below from your AWIPS LX workstation as user ‘awips.

  1. Setup Account - In AWIPS ( Only have to do this one time) 

    1. [awips@lx2-xxx]: git config --global user.name "David Tomalak"  (Use your name in place of mine)

    2. [awips@lx2-xxx]: git config --global user.email "David.Tomalak@noaa.gov"  (Use your email address in place of mine)

  2. Clone the repo and then copy-in your site’s Hazard Services SITE level overrides

    1. [awips@lx2-xxx]: cd /awips2/edex/data/utility/common_static/site/XXX  (Where XXX is your SITEID)

    2. [awips@lx2-xxx]: mkdir HazardServicesTemp 

    3. [awips@lx2-xxx]: git clone https://david.tomalak@vlab.noaa.gov/code-review/a/hazard_services_overrides HazardServicesTemp 

      1. Note: Use your name in place of mine.  Those are underscores between hazard, services and overrides in the URL
    4. [awips@lx2-xxx]: cd HazardServicesTemp/
    5. [awips@lx2-xxx]: git checkout XXX  (XXX is your SITEID)
    6. [awips@lx2-xxx]: rsync -av --exclude=’*.md5’ /awips2/edex/data/utility/common_static/site/XXX/HazardServices/  /awips2/edex/data/utility/common_static/site/XXX/HazardServicesTemp/ 
    7. Suggestion:  Add a Text File Labelled XXX_Override_Notes that identifies any unique overrides that sites may be interested in.  We may add a Seperate WIKI for this.  

 

  1. Push your content to Gerrit

    1. [awips@lx2-xxx]: git add --all  (Note: This command adds all of your changes for your upload)

    2. [awips@lx2-xxx]: git commit

      1. Note: This command commits your changes.  You will be prompted with VI editor.  

      2. At Top (Top Line should be blank for you to insert )

        1. Type i (insert)

        2. Enter a Description ...e.g. “Initial set of hazard service files for WFO BOU”

        3. Hit Esc key

        4. Type :wq!  (colon, w, q, exclamation point) and hit Enter to save the file and exit VI

    3. [awips@lx2-xxx]: git push origin 

      1. You are done.  You can leave HazardServicesTemp in place

 

  1. Done - Review in Redmine

    1. https://vlab.noaa.gov/redmine/projects/hazard_services_overrides/repository

      1. Note: Make sure to select the correct branch (Upper right) 

      2. Note: For future updates, you will use Part II below.  You will only perform Part I once. 

 


Part II - Use this procedure to periodically update HS site files 


  1. Updating an updated file to BOU branch as a new topic

    1. [awips@lx2-xxx]: cd /awips2/edex/data/utility/common_static/site/XXX/HazardServicesTemp

    2. [awips@lx2-xxx]: git pull 

      1. Note: This will make sure you have the latest copy from remote

    3. [awips@lx2-xxx]: rsync -av --exclude=’*.md5’ /awips2/edex/data/utility/common_static/site/XXX/HazardServices/  /awips2/edex/data/utility/common_static/site/XXX/HazardServicesTemp/  

    4. [awips@lx2-xxx]: git checkout XXX (Where XXX is your SITEID)

    5. [awips@lx2-xxx]: git add --all

    6. [awips@lx2-xxx]: git commit 

      1. Note: This command commits your changes.  You will be prompted with VI editor.  

      2. At the Top (Top Line should be blank for you to insert )

        1. Type i (insert)

        2. Enter a Description ...ie “Feb 27 2020 update of hazard service files for WFO XXX”

        3. Hit Esc key

        4. Type :wq!  (colon, w, q, exclamation point) and hit Enter to save the file and exit VI

    7. [awips@lx2-xxx]: git push origin 

    8. Done!   


 

ADDITIONAL INFO NOTES:

  • git fetch :

    • Retrieves the latest changes from the remote repo and stores the latest within a branch named origin/XXX. Fetch does nothing to the checked-out directories.

  • git commit:

    • This command commits your changes.  You will be prompted with VI editor.  

  • git pull :

    • Syncs the local repo with the remote repo and rebases the branch you are on. The checked out directories and files are synchronized with what’s in VLab.  If there are merge conflicts, git will let you know. The local repository stores a copy of the contents of the VLab branches within origin/XXX.

    • So there are really three versions of the repo

      • The remote one that lives on vlab

      • The locally on your machine you have two copies of the repo, one that follows the remote repo and your local version. 

      • The pull first syncs the remote repo to your local repo that follows the remote.  Then rebases your copy with the remote following repo on your local system.