Skip to content

Deploying Changes

From Inside Your Local Container

When you're ready to submit your changes to the handbook, run the following commands:
* git add -A: Adds all the files you've been working on to be selected for the push to the live handbook.
* git commit -m "Message": Commits the files you've added to be pushed. Include a message in the " " describing what you've been working on.
* git push: Pushes the files you've worked on to the live handbook.

You can check the status of this process at any time by using git status.

From your Desktop Machine

You can use this one liner:

handbookBuild

Handbook Build from Container

If you would prefer to be able to do the whole process from inside the container then simply do this:

cat <<EOF >> ~/mkDocs/bashrc.inc.bash
function handbookBuild(){
    echo "building handbook on ec-internal-jira container"
    echo "bash -c 'cd /var/www/vhosts/mkdocs; git pull; mkdocs build'" | ssh ec@192.168.236.107 -p9516
    echo "done..."
}
EOF

ssh-copy-id ec@192.168.236.107 -p9516

And then you can run handbookBuild from inside your local container

Step by Step

You then need to sshContainer 107 to get a session on the ec-internal-jira container on cluster1.

From Inside the Cluster Container

You then need to do the following:

cd /var/www/vhosts/mkdocs
git pull
docsBuild

If you want to check the handbook (or any site) for broken links, you can use these BASH commands to assist:

#wget spider the site, don't save anything, log output to /tmp/wget.spider.log
wget --spider -r -p -nd -o /tmp/wget.spider.log https://www.edmondscommerce.co.uk/handbook/

#grep the output for any requests that did not return a 2XX response
grep -P '^HTTP request sent, awaiting response\.\.\. [^2]\d\d' /tmp/wget.spider.log -B 2 -A 2

#log issues to file:
echo 'Issues Found' > /tmp/wget.spider.issues.log

#Find broken 301s
grep -P 'redirections exceeded' /tmp/wget.spider.log -B 4 > /tmp/wget.spider.issues.log

#Find 4XX requests
grep -P '^HTTP request sent, awaiting response\.\.\. [4]\d\d' /tmp/wget.spider.log -B 2 -A 2 > /tmp/wget/spider.issues.log