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:
parent
b47060808d
commit
95bd888c18
6 changed files with 171 additions and 18 deletions
51
.aspell/.aspell.en.pws
Normal file
51
.aspell/.aspell.en.pws
Normal 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
1
.gitignore
vendored
|
@ -2,3 +2,4 @@ __output/*
|
||||||
!__output/cv.pdf
|
!__output/cv.pdf
|
||||||
tags
|
tags
|
||||||
notes.txt
|
notes.txt
|
||||||
|
aspell_output
|
||||||
|
|
79
.gitlab/ci/bin/spellcheck
Executable file
79
.gitlab/ci/bin/spellcheck
Executable 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
|
|
@ -2,17 +2,7 @@
|
||||||
.use-cv-builder:
|
.use-cv-builder:
|
||||||
image: ${IMAGE_NAME}:master-8b42c9fd
|
image: ${IMAGE_NAME}:master-8b42c9fd
|
||||||
|
|
||||||
test:pdf:
|
.test-conditions:
|
||||||
artifacts:
|
|
||||||
expire_in: 1 hour
|
|
||||||
paths:
|
|
||||||
- __output/cv.pdf
|
|
||||||
extends: .use-cv-builder
|
|
||||||
before_script:
|
|
||||||
- make clean
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- make
|
|
||||||
only:
|
only:
|
||||||
refs:
|
refs:
|
||||||
- merge_requests
|
- merge_requests
|
||||||
|
@ -21,6 +11,34 @@ test:pdf:
|
||||||
- docker/Dockerfile
|
- docker/Dockerfile
|
||||||
- __output/*
|
- __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:
|
publish:pdf:
|
||||||
extends: .use-cv-builder
|
extends: .use-cv-builder
|
||||||
before_script:
|
before_script:
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -2,6 +2,7 @@ DOCKERFILE = ./docker/Dockerfile
|
||||||
IMAGE_NAME ?= cv-builder
|
IMAGE_NAME ?= cv-builder
|
||||||
IMAGE_TAG ?= latest
|
IMAGE_TAG ?= latest
|
||||||
OUTPUT_DIR = __output/
|
OUTPUT_DIR = __output/
|
||||||
|
CV_DATA_FILE = ./data/cv.json
|
||||||
|
|
||||||
.PHONY: all image publish tex pdf clean
|
.PHONY: all image publish tex pdf clean
|
||||||
|
|
||||||
|
@ -13,6 +14,9 @@ image:
|
||||||
publish: image
|
publish: image
|
||||||
@docker push $(IMAGE_NAME):$(IMAGE_TAG)
|
@docker push $(IMAGE_NAME):$(IMAGE_TAG)
|
||||||
|
|
||||||
|
spellcheck:
|
||||||
|
@./.gitlab/ci/bin/spellcheck -i $(CV_DATA_FILE)
|
||||||
|
|
||||||
tex:
|
tex:
|
||||||
@go run .
|
@go run .
|
||||||
|
|
||||||
|
|
14
data/cv.json
14
data/cv.json
|
@ -12,7 +12,7 @@
|
||||||
},
|
},
|
||||||
"summary": [
|
"summary": [
|
||||||
"I have over four years of professional experience in DevOps and Platform Automation.",
|
"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.",
|
"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",
|
"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.",
|
"and I would like to continue increasing my knowledge and experience in Go and use it more professionally.",
|
||||||
|
@ -99,14 +99,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"details": [
|
"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 provided assistance for creating a Cassandra Operator using Go.",
|
||||||
"I’ve deployed new SIT Kubernetes environments on Openstack using GitOps.",
|
"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 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 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 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 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": [
|
"details": [
|
||||||
"I've built and supported production infrastructure hosted in UKCloud (for public sector projects) and AWS (for commercial projects).",
|
"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 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 built a cross-domain protective monitoring solution using the Elastic stack with Redis.",
|
||||||
"I've installed and configured Nagios/Icinga for infrastructure monitoring.",
|
"I've installed and configured Nagios/Icinga for infrastructure monitoring.",
|
||||||
|
|
Loading…
Reference in a new issue