These are the instructions for publishing the latest tssg.tech content changes to the web site.

Web Site Instances

When a user navigates their web browser to tssg.tech, the domain is web forwarded to https://technologynursery.org/tssgTech.

There are three such sites being served.

  • tssgTech - The main web site.
  • tssgTechMultipage - A development/test staging area that is updated with the latest code from the multipage branch every 5 minutes by a cron job running as the root user (crontab -e).  The script is located in s14:/root/tssgTech/tools/tssgTech.deploy.
  • tssgTechStagedMaster - A test staging area that is updated with the latest from the master branch every 5 minutes by a cron job running as the root user (crontab -e).  The script is located in s14:/root/tssgTech/tools/tssgTech.deploy.

Step-by-step guide to update the tssg.tech content

Pre-requisite: Ensure you have access to server ubuntu-Studio-14 (i.e. s14) in Navarro Computing's subnet.

  1. Connect to the s14 server.

    ssh technologynursery.org
  2. Navigate to the tssgTech local git repo.

    cd /home/ralph/Projects/TSSG/tssgTech
  3. Get the latest source changes from the remote git repo to the local git repo on the server.

    git pull
  4. Copy the latest source changes from the local git repo on the server to the tssgTech content folder in the nc-nginx container.

    cd ..
    docker cp tssgTech nc-nginx:/usr/share/nginx/html/

 Additional Information contributed by Joel Sharasheff :

A single alias command can now run our Production web file updates.
The above steps are a shorthand of what needs to be done to update the tssg.tech web site with the latest code from the git repository.

After getting the ability to connect to the s14 server and setting up the alias (thanks Ralph!), I can now run this single command (tssgTech.update) from my git bash window. There is no need to run several commands from an ssh command window that is connected directly to the s14 server. Of course, this single command must also be followed by any password phrase for entry to the Git server and for entry to the remote server that you have set up beforehand.


[I removed the literal paths from the alias until I know that it's safe to post them here.]

alias tssgTech.update='ssh -t s14 "cd ~administrator/.../tssgTech; sudo su -c \"git pull\" ralph; cd ..; docker cp tssgTech nc-nginx:/.../html/"'

This single alias, tssgTech.update, sets up the following actions in a single command.
1. connect to s14  with ssh -t         ** (explanation from stackoverflow of why -t argument is used to avoid the error
                                                             sudo: no tty present and no askpass program specified)
2. cd to the tssgTech directory on the s14 server
3. run a git pull on the s14 server to retrieve the latest code files
4. change the directory back to the root below the web site directory
5. run the docker command to copy the latest web site files to the s14 web server

** sudo requires a tty to prompt for a password, and when specifying commands to run to ssh, it doesn't allocate one by default since this is normally used to run non interactive commands that may transfer binary data, which can trip up the tty.



1 Comment

  1. The following is information open for discussion related to our future source control of changes for the TSSG web site.

    Current Git development environment for tssg.tech:
    Using a master branch of repository tssgTechMVP.git (Minimal Viable Project)
    Currently making (schedule.html) changes directly to the master branch.
    pushing changes to the server in tssgTechMVP (testing from http://technologynursery.org/tssgTechMVP)
    Running an update command to git pull the latest from master and copy to tssgTech

    Git Flow alternatives
    (leaving out git-flow application with it's own commands; trying to stay with plain Git commands)

    1. GitHub flow
    commits to feature branches
    feature branches merged to master
    all commits to master are considered stable
    feature branch is deleted after merge to master

    • Good option because we don't need to support more than 1 version of release. Will this be true?

    2. Git Flow (see the link at the bottom of the article for more information)

    master branch is only for release or hotfix branches. commits to master are tagged immediately
    a develop branch is never deleted.
    feature branches are merged to the develop branch when ready
    release branches branched off of develop. code merged from develop branch to the release-* branch.
    hotfix branches for immediate release. merged to master and tagged. merged to develop or release branch.

    • More complexity than we need.

    3. TSSG Flow (modeled after Mike McQuaid's Mike Flow from his book Git In Practice)
    Same as GitHub Flow with
    a. branches should be rebased, rewritten, or squashed to make history cleaner if possible
      (probably not necessary with a limited number of changes per major release)
    b. Tag the stable releases on the master branch. Major.Minor.BugFix

    • Probably best model for TSSG

    Current Plan (open for discussion!)
    Current release (tag of master branch) of tssg.tech code is 2.0
    Continue to pull from master that is holding the singlepage design. Updates continue to be made to master.
      cron job pulls from master to tssgTechMVP
        consider re-naming the git repository and the url directory (directory could be tssgTechStage)
      Code in tssgTechMVP is then copied to production with an alias command tssg.update. 

    We want to have 1 new release branch mp_master_release 
    For this branch we will need a tssgTechStage2 url directory. (allows us to test what is in development)

    Eventually we could change the cron job and update job to pull and copy from whatever branch we add to the repository.

    Our next release is 3.0.0; schedule changes will be 3.0.x; new schedule implementation will be 3.1.x;
    Tag master with 3.0.0 as soon as multipage release branch is complete.

    Changes to the server
    tssgTechMVP renamed to tssgTechStage
    pull master to tssgTechStage for web testing before copy to production
    pull mp_master_release branch to new directory tssgTechStage2 for web testing before merge to master
    Ralph has to know which feature branch to pull to tssgTechStage or tssgTechStage2

    Changes to cron job:
    pull from master to tssgTechStage
    pull from feature_multipage to tssgTechStage2

    1. Need to create and add code to the mp_master_release branch.
    2. Need to have Ralph make changes to the server and cron job.