From 0ceedb1c4410ee16b7d062537c2cbececc7f0401 Mon Sep 17 00:00:00 2001 From: Tristan Morgan Date: Thu, 30 Jul 2020 15:05:03 +1000 Subject: [PATCH] The Challenge is set. --- .circleci/config.yml | 42 +++++++++---------- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .gitignore | 2 +- ASSESSMENT.md | 12 +++--- Dockerfile | 12 +++--- build.sh | 6 +-- cmd/root.go | 6 +-- cmd/serve.go | 2 +- cmd/updatedb.go | 2 +- daemon/deamon.go | 2 +- db/db.go | 2 +- ...ronment-variables-overrides-config-file.md | 2 +- doc/config.md | 4 +- doc/readme.md | 36 ++++++++-------- go.mod | 2 +- main.go | 4 +- readme.md | 20 ++++----- ui/api.go | 4 +- ui/index.go | 2 +- ui/ui.go | 2 +- 20 files changed, 83 insertions(+), 83 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b2fe707b..8f3cef1c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ version: 2 jobs: build: - working_directory: /go/src/github.com/servian/TechTestApp + working_directory: /go/src/github.com/servian/TechChallengeApp docker: - image: circleci/golang:latest @@ -17,7 +17,7 @@ jobs: - run: go test -v -race -cover ./... deploy: - working_directory: /go/src/github.com/servian/TechTestApp + working_directory: /go/src/github.com/servian/TechChallengeApp docker: - image: circleci/golang:latest @@ -29,9 +29,9 @@ jobs: command: | go get -v -t -d ./... mkdir output - go build -v -o TechTestApp . + go build -v -o TechChallengeApp . ls - ./TechTestApp --version | sed -e 's/TechTestApp version /v./' > versionfile + ./TechChallengeApp --version | sed -e 's/TechChallengeApp version /v./' > versionfile - run: @@ -46,17 +46,17 @@ jobs: mkdir -p dist - go build -v -o TechTestApp . + go build -v -o TechChallengeApp . - cp TechTestApp dist/ + cp TechChallengeApp dist/ cp -r assets dist/ cp conf.toml dist/ - rm TechTestApp + rm TechChallengeApp export version=$(cat versionfile) - zip -r "output/TechTestApp_${version}_linux64.zip" dist/* + zip -r "output/TechChallengeApp_${version}_linux64.zip" dist/* # build for macos - run: @@ -71,17 +71,17 @@ jobs: mkdir -p dist - go build -v -o TechTestApp . + go build -v -o TechChallengeApp . - cp TechTestApp dist/ + cp TechChallengeApp dist/ cp -r assets dist/ cp conf.toml dist/ - rm TechTestApp + rm TechChallengeApp export version=$(cat versionfile) - zip -r "output/TechTestApp_${version}_darwin.zip" dist/* + zip -r "output/TechChallengeApp_${version}_darwin.zip" dist/* # build windows 64 bit - run: @@ -100,17 +100,17 @@ jobs: mkdir -p dist - go build -v -o TechTestApp.exe . + go build -v -o TechChallengeApp.exe . - cp TechTestApp.exe dist/ + cp TechChallengeApp.exe dist/ cp -r assets dist/ cp conf.toml dist/ - rm TechTestApp.exe + rm TechChallengeApp.exe export version=$(cat versionfile) - zip -r "output/TechTestApp_${version}_win64.zip" dist/* + zip -r "output/TechChallengeApp_${version}_win64.zip" dist/* #build windows 32 bit - run: @@ -125,17 +125,17 @@ jobs: mkdir -p dist - go build -v -o TechTestApp.exe . + go build -v -o TechChallengeApp.exe . - cp TechTestApp.exe dist/ + cp TechChallengeApp.exe dist/ cp -r assets dist/ cp conf.toml dist/ - rm TechTestApp.exe + rm TechChallengeApp.exe export version=$(cat versionfile) - zip -r "output/TechTestApp_${version}_win32.zip" dist/* + zip -r "output/TechChallengeApp_${version}_win32.zip" dist/* - run: name: Release if new version @@ -171,4 +171,4 @@ workflows: branches: only: master tags: - ignore: /.*/ \ No newline at end of file + ignore: /.*/ diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 704a5645..dacbc87e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,7 +2,7 @@ Please explain the changes you made here. -Fixes: https://github.com/servian/TechTestApp/issues/{issue number} +Fixes: https://github.com/servian/TechChallengeApp/issues/{issue number} ### Checklist diff --git a/.gitignore b/.gitignore index 1b93d75c..4f0aefd8 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,4 @@ dist/ /vendor # Output Binary -TechTestApp \ No newline at end of file +TechChallengeApp diff --git a/ASSESSMENT.md b/ASSESSMENT.md index a8c053ba..45b01660 100644 --- a/ASSESSMENT.md +++ b/ASSESSMENT.md @@ -6,7 +6,7 @@ There *should not* be a requirement for Servian to access a candidate's cloud se Demonstrate regular commits and good git workflow practices. -There is no time limit for this test. +There is no time limit for this challenge. Candidates should provide documentation on their solution, including: @@ -51,7 +51,7 @@ Candidates will be assessed across the following categories: - Auto scaling and highly available frontend - Highly available Database -## Tech Test Application +## Tech Challenge Application Single page application designed to be ran inside a container or on a vm (IaaS) with a postgres database to store data. @@ -67,9 +67,9 @@ It is completely self contained, and should not require any additional dependenc update `conf.toml` with database settings -`./TechTestApp updatedb` to create a database and seed it with test data +`./TechChallengeApp updatedb` to create a database and seed it with test data -`./TechTestApp serve` will start serving requests +`./TechChallengeApp serve` will start serving requests ## Interesting endpoints @@ -89,7 +89,7 @@ update `conf.toml` with database settings ### Process -`go get -d github.com/Servian/TechTestApp` +`go get -d github.com/Servian/TechChallengeApp` run `build.sh` @@ -97,4 +97,4 @@ the `dist` folder contains the compiled web package ### Docker build -`docker build . -t techtestapp:latest` \ No newline at end of file +`docker build . -t techchallengeapp:latest` diff --git a/Dockerfile b/Dockerfile index bb392176..a3834634 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,26 +12,26 @@ RUN go get -d -v github.com/go-swagger/go-swagger \ && mv /tmp/swagger-ui-$SWAGGER_UI_VERSION /tmp/swagger \ && sed -i 's#"https://petstore\.swagger\.io/v2/swagger\.json"#"./swagger.json"#g' /tmp/swagger/dist/index.html -WORKDIR $GOPATH/src/github.com/servian/TechTestApp +WORKDIR $GOPATH/src/github.com/servian/TechChallengeApp -COPY go.mod go.sum $GOPATH/src/github.com/servian/TechTestApp/ +COPY go.mod go.sum $GOPATH/src/github.com/servian/TechChallengeApp/ RUN go mod tidy COPY . . -RUN go build -o /TechTestApp +RUN go build -o /TechChallengeApp RUN swagger generate spec -o /swagger.json FROM alpine:latest -WORKDIR /TechTestApp +WORKDIR /TechChallengeApp COPY assets ./assets COPY conf.toml ./conf.toml COPY --from=build /tmp/swagger/dist ./assets/swagger COPY --from=build /swagger.json ./assets/swagger/swagger.json -COPY --from=build /TechTestApp TechTestApp +COPY --from=build /TechChallengeApp TechChallengeApp -ENTRYPOINT [ "./TechTestApp" ] +ENTRYPOINT [ "./TechChallengeApp" ] diff --git a/build.sh b/build.sh index 88fa3ac3..bbf19f6b 100755 --- a/build.sh +++ b/build.sh @@ -8,10 +8,10 @@ mkdir -p dist go mod tidy -go build -o TechTestApp . +go build -o TechChallengeApp . -cp TechTestApp dist/ +cp TechChallengeApp dist/ cp -r assets dist/ cp conf.toml dist/ -rm TechTestApp +rm TechChallengeApp diff --git a/cmd/root.go b/cmd/root.go index e5bb7b07..f4e7972b 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -24,8 +24,8 @@ import ( "fmt" "os" - "github.com/servian/TechTestApp/config" - "github.com/servian/TechTestApp/daemon" + "github.com/servian/TechChallengeApp/config" + "github.com/servian/TechChallengeApp/daemon" "github.com/spf13/cobra" ) @@ -34,7 +34,7 @@ var cfg *daemon.Config // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ - Use: "TechTestApp", + Use: "TechChallengeApp", Short: "Application used to test potential candidates at Servian", Long: ` .:ooooool, .:odddddl;. .;ooooc. .l, ;c. ::. 'coddddoc' ,looooooc. diff --git a/cmd/serve.go b/cmd/serve.go index b14965ea..15e81946 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -24,7 +24,7 @@ import ( "log" "net/http" - "github.com/servian/TechTestApp/daemon" + "github.com/servian/TechChallengeApp/daemon" "github.com/spf13/cobra" ) diff --git a/cmd/updatedb.go b/cmd/updatedb.go index 0596f6e2..3635230e 100644 --- a/cmd/updatedb.go +++ b/cmd/updatedb.go @@ -23,7 +23,7 @@ package cmd import ( "fmt" - "github.com/servian/TechTestApp/db" + "github.com/servian/TechChallengeApp/db" "github.com/spf13/cobra" ) diff --git a/daemon/deamon.go b/daemon/deamon.go index 013816bc..43d181f2 100644 --- a/daemon/deamon.go +++ b/daemon/deamon.go @@ -27,7 +27,7 @@ import ( "os/signal" "syscall" - "github.com/servian/TechTestApp/ui" + "github.com/servian/TechChallengeApp/ui" ) // Config - configuration for daemon package diff --git a/db/db.go b/db/db.go index af699173..dfe8acbd 100644 --- a/db/db.go +++ b/db/db.go @@ -28,7 +28,7 @@ import ( "github.com/lib/pq" _ "github.com/lib/pq" - "github.com/servian/TechTestApp/model" + "github.com/servian/TechChallengeApp/model" ) // Config - configuration for the db package diff --git a/doc/adr/0006-environment-variables-overrides-config-file.md b/doc/adr/0006-environment-variables-overrides-config-file.md index ceb0b6ff..70e7dd31 100644 --- a/doc/adr/0006-environment-variables-overrides-config-file.md +++ b/doc/adr/0006-environment-variables-overrides-config-file.md @@ -10,7 +10,7 @@ Supercedes [4. config only in config file](0004-config-only-in-config-file.md) ## Context -In some environments the port and other variables are only available on startup, and will have to be overriden. See https://github.com/servian/TechTestApp/issues/21 +In some environments the port and other variables are only available on startup, and will have to be overriden. See https://github.com/servian/TechChallengeApp/issues/21 ## Decision diff --git a/doc/config.md b/doc/config.md index 437b9882..657e923c 100644 --- a/doc/config.md +++ b/doc/config.md @@ -1,4 +1,4 @@ -# TechTestApp - Configuration +# TechChallengeApp - Configuration This doc outlines how to configure the application using the config file. The main way to configure the application is through the configuration file, but it is possible to override the settings using environment variables. @@ -32,4 +32,4 @@ The application will look for environment variables that are able to override th Environment variables has precedence over configuration from the `conf.toml` file -More details on each of the configuration values can be found in the section on the configuration file. \ No newline at end of file +More details on each of the configuration values can be found in the section on the configuration file. diff --git a/doc/readme.md b/doc/readme.md index 80842600..a63ff607 100644 --- a/doc/readme.md +++ b/doc/readme.md @@ -1,20 +1,20 @@ -# TechTestApp +# TechChallengeApp [![Build Status][circleci-badge]][circleci] [![Release][release-badge]][release] [![GoReportCard][report-badge]][report] [![License][license-badge]][license] -[circleci-badge]: https://circleci.com/gh/servian/TechTestApp.svg?style=shield&circle-token=8dfd03c6c2a5dc5555e2f1a84c36e33bc58ad0aa -[circleci]: https://circleci.com/gh/servian/TechTestApp -[release-badge]: http://img.shields.io/github/release/servian/TechTestApp/all.svg?style=flat -[release]:https://github.com/servian/TechTestApp/releases -[report-badge]: https://goreportcard.com/badge/github.com/servian/TechTestApp -[report]: https://goreportcard.com/report/github.com/servian/TechTestApp -[license-badge]: https://img.shields.io/github/license/servian/TechTestApp.svg?style=flat -[license]: https://github.com/servian/TechTestApp/license +[circleci-badge]: https://circleci.com/gh/servian/TechChallengeApp.svg?style=shield&circle-token=8dfd03c6c2a5dc5555e2f1a84c36e33bc58ad0aa +[circleci]: https://circleci.com/gh/servian/TechChallengeApp +[release-badge]: http://img.shields.io/github/release/servian/TechChallengeApp/all.svg?style=flat +[release]:https://github.com/servian/TechChallengeApp/releases +[report-badge]: https://goreportcard.com/badge/github.com/servian/TechChallengeApp +[report]: https://goreportcard.com/report/github.com/servian/TechChallengeApp +[license-badge]: https://img.shields.io/github/license/servian/TechChallengeApp.svg?style=flat +[license]: https://github.com/servian/TechChallengeApp/license -The Servian techtest app is a golang application used for testing candidates applying to work with Servian. +The Servian tech challenge app is a golang application used for challenging candidates applying to work with Servian. ## Documentation structure @@ -27,7 +27,7 @@ Architectural decisions are recorded in the `adr` folder, details on why can be Naming convention: `####-` where the first 4 digits are iterated by 1 for each record. -## Tech Test Application +## Tech Challenge Application Single page application designed to be ran inside a container or on a vm (IaaS) with a postgres database to store data. @@ -54,9 +54,9 @@ Tested against: update `conf.toml` with database settings (details on how to configure the application can be found in [config.md](config.md)) -`TechTestApp updatedb` to create a database, tables, and seed it with test data. Use `-s` to skip creating the database and only create tabls and seed data. +`TechChallengeApp updatedb` to create a database, tables, and seed it with test data. Use `-s` to skip creating the database and only create tabls and seed data. -`TechTestApp serve` will start serving requests +`TechChallengeApp serve` will start serving requests ## Interesting endpoints @@ -111,7 +111,7 @@ If building using docker you need to have docker installed on your local machine Download the application using go get: -`go get -d github.com/servian/TechTestApp` +`go get -d github.com/servian/TechChallengeApp` run `build.sh` to download all the dependencies and compile the application @@ -121,15 +121,15 @@ the `dist` folder contains the compiled web package To build a docker image with the application installed on it -`docker build . -t techtestapp:latest` +`docker build . -t techchallengeapp:latest` ### Pull Image from Github packages -Go to the [packages](https://github.com/servian/TechTestApp/packages) section for an already built docker image. +Go to the [packages](https://github.com/servian/TechChallengeApp/packages) section for an already built docker image. To pull a ready built docker image with the application installed on it, [setup](https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages) docker to auth to Github then: -`docker pull docker.pkg.github.com/servian/techtestapp/techtestapp:latest` +`docker pull docker.pkg.github.com/servian/techchallengeapp/techchallengeapp:latest` ## Continuous Integration @@ -155,4 +155,4 @@ Builds will be produced for: * Windows (x86/amd64) #### Note -* If you are setting up the database using RDS, do not run the `./TechTestApp updatedb` command. Instead run `./TechTestApp updatedb -s` +* If you are setting up the database using RDS, do not run the `./TechChallengeApp updatedb` command. Instead run `./TechChallengeApp updatedb -s` diff --git a/go.mod b/go.mod index 52c28725..ac36476c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/servian/TechTestApp +module github.com/servian/TechChallengeApp go 1.14 diff --git a/main.go b/main.go index 2e529ef3..e12a1be6 100644 --- a/main.go +++ b/main.go @@ -18,7 +18,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -// Servian Tech Test Application +// Servian Tech Challenge Application // // This application is used as part of the Servian Technical Assessment. // @@ -28,7 +28,7 @@ // swagger:meta package main -import "github.com/servian/TechTestApp/cmd" +import "github.com/servian/TechChallengeApp/cmd" func main() { cmd.Execute() diff --git a/readme.md b/readme.md index 20468aee..92818775 100644 --- a/readme.md +++ b/readme.md @@ -1,18 +1,18 @@ -# Servian DevOps Tech Challenge - TechTest App +# Servian DevOps Tech Challenge - Tech Challenge App [![Build Status][circleci-badge]][circleci] [![Release][release-badge]][release] [![GoReportCard][report-badge]][report] [![License][license-badge]][license] -[circleci-badge]: https://circleci.com/gh/servian/TechTestApp.svg?style=shield&circle-token=8dfd03c6c2a5dc5555e2f1a84c36e33bc58ad0aa -[circleci]: https://circleci.com/gh/servian/TechTestApp -[release-badge]: http://img.shields.io/github/release/servian/TechTestApp/all.svg?style=flat -[release]:https://github.com/Servian/TechTestApp/releases -[report-badge]: https://goreportcard.com/badge/github.com/Servian/TechTestApp -[report]: https://goreportcard.com/report/github.com/Servian/TechTestApp -[license-badge]: https://img.shields.io/github/license/Servian/TechTestApp.svg?style=flat -[license]: https://github.com/Servian/TechTestApp/license +[circleci-badge]: https://circleci.com/gh/servian/TechChallengeApp.svg?style=shield&circle-token=8dfd03c6c2a5dc5555e2f1a84c36e33bc58ad0aa +[circleci]: https://circleci.com/gh/servian/TechChallengeApp +[release-badge]: http://img.shields.io/github/release/servian/TechChallengeApp/all.svg?style=flat +[release]:https://github.com/Servian/TechChallengeApp/releases +[report-badge]: https://goreportcard.com/badge/github.com/Servian/TechChallengeApp +[report]: https://goreportcard.com/report/github.com/Servian/TechChallengeApp +[license-badge]: https://img.shields.io/github/license/Servian/TechChallengeApp.svg?style=flat +[license]: https://github.com/Servian/TechChallengeApp/license ## Overview @@ -30,4 +30,4 @@ Information about the assessment is available in the [assessment.md file](ASSESS ## Found an issue? -If you've found an issue with the application, the documentation, or anything else, we are happy to take contributions. Please raise an issue in the [github repository](https://github.com/Servian/TechTestApp/issues) and read through the contribution rules found the [CONTRIBUTING.md](CONTRIBUTING.md) file for the details. +If you've found an issue with the application, the documentation, or anything else, we are happy to take contributions. Please raise an issue in the [github repository](https://github.com/Servian/TechChallengeApp/issues) and read through the contribution rules found the [CONTRIBUTING.md](CONTRIBUTING.md) file for the details. diff --git a/ui/api.go b/ui/api.go index 7dc8a994..95ce3d3e 100644 --- a/ui/api.go +++ b/ui/api.go @@ -28,8 +28,8 @@ import ( "strconv" "github.com/gorilla/mux" - "github.com/servian/TechTestApp/db" - "github.com/servian/TechTestApp/model" + "github.com/servian/TechChallengeApp/db" + "github.com/servian/TechChallengeApp/model" ) // TaskID parameter. diff --git a/ui/index.go b/ui/index.go index 1c96c77f..3aa1c081 100644 --- a/ui/index.go +++ b/ui/index.go @@ -39,7 +39,7 @@ const indexHTML = ` - Servian Tech Test App + Servian Tech Challenge App diff --git a/ui/ui.go b/ui/ui.go index 874b26ae..de7bb4e6 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -27,7 +27,7 @@ import ( "time" "github.com/gorilla/mux" - "github.com/servian/TechTestApp/db" + "github.com/servian/TechChallengeApp/db" ) // Config configuration for ui package