ci: add spell checking in CI pipeline

This commit adds a spell checking job to the testing
stage of the GitLab CI pipeline.
GNU Aspell is used to check the spelling of the JSON
CV.

The following changes are made in this commit:

- created a wrapper script that uses GNU Aspell to check
the word spellings in the CV. Errors are printed to the screen.
- created a make target to run the spellcheck script.
- created a new job in the test stage to run the new make target.
- create a custom word list for this project.
- corrections made in CV.
This commit is contained in:
Dan Anglin 2020-02-08 13:56:21 +00:00
parent b47060808d
commit 95bd888c18
No known key found for this signature in database
GPG key ID: 7AC2B18EC1D09F27
6 changed files with 171 additions and 18 deletions

51
.aspell/.aspell.en.pws Normal file
View file

@ -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

1
.gitignore vendored
View file

@ -2,3 +2,4 @@ __output/*
!__output/cv.pdf
tags
notes.txt
aspell_output

79
.gitlab/ci/bin/spellcheck Executable file
View file

@ -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

View file

@ -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:

View file

@ -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 .

View file

@ -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": [
"Ive 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.",
"Ive deployed new SIT Kubernetes environments on Openstack using GitOps.",
"Ive created management services on Kubernetes using CronJobs to automate the maintenance of Elasticsearch clusters.",
"Ive 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.",
"Ive 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.",