You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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 http://technologynursery.org/tssgTech.

There are three such sites being served.

  • tssgTech - The main web site.
  • tssgTechMVP - A development/test staging area that is updated with the latest code from the git source repository every 5 minutes by a cron job running as the root user (crontab -e).  The script is located in /root/bin/tssgTechMVP.deploy.
  • tssgTechPoc - An old Proof of Concept site (last updated April 16, 2018).

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.



  • No labels