Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Connect to the s14 server.

    Code Block
    ssh technologynursery.org


  2. Navigate to the tssgTech local git repo.

    Code Block
    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.

    Code Block
    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.

    Code Block
    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.

...