diff --git a/.aspell/.aspell.en.pws b/.aspell/.aspell.en.pws new file mode 100644 index 0000000..cab2afa --- /dev/null +++ b/.aspell/.aspell.en.pws @@ -0,0 +1,51 @@ +personal_ws-1.1 en 1 +Alertmanager +Anglin +Ansible +Atlassian +AWS +CACI +CentOS +CloudFormation +CronJobs +DevOps +ECS +Elasticsearch +Ellenbrook +firstName +Fluentd +Gitea +github +gitlab +GitLab +GitOps +Grafana +HAProxy +Hertfordshire +Icinga +Kanban +Keepalive +Kubernetes +jobTitle +JIRA +JLPT +Kibana +lastName +Logstash +LXD +MEng +Metacontroller +Nagios +Ocado +OpenAPI +Openstack +Patroni +Postgres +PostgreSQL +Reddit +RedHat +Redis +UKCloud +UKCloud's +Welwyn +Worthing diff --git a/.gitignore b/.gitignore index 2a57d3c..d6b618a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ __output/* !__output/cv.pdf tags notes.txt +aspell_output diff --git a/.gitlab/ci/bin/spellcheck b/.gitlab/ci/bin/spellcheck new file mode 100755 index 0000000..2db23dc --- /dev/null +++ b/.gitlab/ci/bin/spellcheck @@ -0,0 +1,79 @@ +#!/usr/bin/env bash + +set -euo pipefail + +ASPELL_LANG='en_GB' +ASPELL_PERSONAL_WORDLIST='./.aspell/.aspell.en.pws' +DEFAULT_OUTPUT='aspell_output' + +RED='\033[1;31m' +AMBER='\033[1;33m' +GREEN='\033[1;32m' +NC='\033[0m' + +inputFile='' +outputFile='' + +usage () { +echo "Usage:" +echo "spellcheck [OPTION]..." +echo +echo "Description:" +echo -e "\tspellcheck is a wrapper script that uses aspell to check the spelling of" +echo -e "\tall words in a file. Any detected spelling errors are printed to screen" +echo -e "\tand to an output file." +echo +echo "Options:" +echo -e "\t-i\tinput file for spell checking." +echo -e "\t-o\toutput file where list of spelling errors are written to." +echo -e "\t\tThe default output file is ${DEFAULT_OUTPUT}." +echo -e "\t-h\tprints usage." +echo +echo -e "Examples:" +echo -e "\tspellcheck -i my_file.txt -o output.txt" +echo -e "\tspellcheck -i my_file" +} + +validate_args() { + if [ -z "$inputFile" ]; then + echo -e "${RED}ERROR: ${NC}Option '-i' is not set or is empty." + usage + return 1 + fi + + if [ -z "$outputFile" ]; then + echo -e "${AMBER}WARNING: ${NC}Option '-o' is not set or is empty. The output file will be set to ${DEFAULT_OUTPUT}" + outputFile=${DEFAULT_OUTPUT} + fi + + return 0 +} + +spellcheck() { + cat ${inputFile} | aspell -d ${ASPELL_LANG} -p ${ASPELL_PERSONAL_WORDLIST} list > ${outputFile} + + let spellingErrors=$( cat ${outputFile} | wc -l ) + if [ $spellingErrors -gt 0 ]; then + echo + echo -e "${RED}ERROR: ${NC}The following spelling errors were found in ${inputFile}:" + cat ${outputFile} + return 1 + else + echo + echo -e "${GREEN}INFO: ${NC}No spelling errors found." + fi + + return 0 +} + +while getopts 'i:o:h' flag; do + case "${flag}" in + i) inputFile=${OPTARG} ;; + o) outputFile=${OPTARG} ;; + h) usage && exit 0 ;; + *) usage && exit 2 ;; + esac +done + +validate_args || exit 1 +spellcheck || exit 1 diff --git a/.gitlab/ci/cv-gitlab-ci.yml b/.gitlab/ci/cv-gitlab-ci.yml index 53cb3a5..3a1c816 100644 --- a/.gitlab/ci/cv-gitlab-ci.yml +++ b/.gitlab/ci/cv-gitlab-ci.yml @@ -2,17 +2,7 @@ .use-cv-builder: image: ${IMAGE_NAME}:master-8b42c9fd -test:pdf: - artifacts: - expire_in: 1 hour - paths: - - __output/cv.pdf - extends: .use-cv-builder - before_script: - - make clean - stage: test - script: - - make +.test-conditions: only: refs: - merge_requests @@ -21,6 +11,34 @@ test:pdf: - docker/Dockerfile - __output/* +test:spellcheck: + before_script: + - apt-get update + - apt-get -y install aspell make + extends: + - .test-conditions + image: ubuntu:18.04 + stage: test + script: + - make spellcheck + only: + refs: + - merge_requests + +test:pdf: + artifacts: + expire_in: 1 hour + paths: + - __output/cv.pdf + extends: + - .use-cv-builder + - .test-conditions + before_script: + - make clean + stage: test + script: + - make + publish:pdf: extends: .use-cv-builder before_script: diff --git a/Makefile b/Makefile index a7e1afc..f528523 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ DOCKERFILE = ./docker/Dockerfile IMAGE_NAME ?= cv-builder IMAGE_TAG ?= latest OUTPUT_DIR = __output/ +CV_DATA_FILE = ./data/cv.json .PHONY: all image publish tex pdf clean @@ -13,6 +14,9 @@ image: publish: image @docker push $(IMAGE_NAME):$(IMAGE_TAG) +spellcheck: + @./.gitlab/ci/bin/spellcheck -i $(CV_DATA_FILE) + tex: @go run . diff --git a/data/cv.json b/data/cv.json index 012a8d1..501a748 100644 --- a/data/cv.json +++ b/data/cv.json @@ -12,7 +12,7 @@ }, "summary": [ "I have over four years of professional experience in DevOps and Platform Automation.", - "My experience ranges from provisioning VMs and automating software installation using Ansible and Puppet", + "My experience ranges from provisioning virtual machines and automating software installation using Ansible and Puppet", "to provisioning new Kubernetes environments using GitOps and creating Operators for the auto-provisioning and maintenance of PostgreSQL clusters on Kubernetes.", "Throughout my time with Ocado Technology I have developed an interest in the Go programming language", "and I would like to continue increasing my knowledge and experience in Go and use it more professionally.", @@ -99,14 +99,14 @@ } }, "details": [ - "I’ve created a Postgres Operator using Go and the Metacontroller which is used to create and manage Patroni PostgreSQL clusters onto production Kubernetes environments.", + "I've created a Postgres Operator using Go and the Metacontroller which is used to create and manage Patroni PostgreSQL clusters onto production Kubernetes environments.", "I've provided assistance for creating a Cassandra Operator using Go.", - "I’ve deployed new SIT Kubernetes environments on Openstack using GitOps.", - "I’ve created management services on Kubernetes using CronJobs to automate the maintenance of Elasticsearch clusters.", - "I’ve deployed Prometheus, Alertmanager and Grafana onto Kubernetes for monitoring database services such as PostgreSQL, Cassandra and Elasticsearch.", + "I've deployed new SIT Kubernetes environments on Openstack using GitOps.", + "I've created management services on Kubernetes using CronJobs to automate the maintenance of Elasticsearch clusters.", + "I've deployed Prometheus, Alertmanager and Grafana onto Kubernetes for monitoring database services such as PostgreSQL, Cassandra and Elasticsearch.", "I was part of the monitoring and alerting work group to help integrate all infrastructure monitoring stacks into a centralised monitoring service.", "I've supported development tools such as GitLab and Nexus in AWS by performing various upgrade and maintenance tasks via CloudFormation and Puppet.", - "I’ve used AWS CloudFormation and ECS to provision a monitoring stack for GitLab." + "I've used AWS CloudFormation and ECS to provision a monitoring stack for GitLab." ] }, { @@ -125,7 +125,7 @@ }, "details": [ "I've built and supported production infrastructure hosted in UKCloud (for public sector projects) and AWS (for commercial projects).", - "My general tasks included creating Ansible playbooks for network configuration, hardening of RedHat/CentOS VMs and for software installation and configuration.", + "My general tasks included creating Ansible playbooks for network configuration, hardening of RedHat/CentOS virtual machines and for software installation and configuration.", "I've set up resilient and fault-tolerant infrastructure using tools such as HAProxy and Keepalive.", "I've built a cross-domain protective monitoring solution using the Elastic stack with Redis.", "I've installed and configured Nagios/Icinga for infrastructure monitoring.",