Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -171,4 +171,4 @@ workflows:
branches:
only: master
tags:
ignore: /.*/
ignore: /.*/
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ dist/
/vendor

# Output Binary
TechTestApp
TechChallengeApp
12 changes: 6 additions & 6 deletions ASSESSMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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.

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

Expand All @@ -89,12 +89,12 @@ update `conf.toml` with database settings

### Process

`go get -d github.com/Servian/TechTestApp`
`go get -d github.com/Servian/TechChallengeApp`

run `build.sh`

the `dist` folder contains the compiled web package

### Docker build

`docker build . -t techtestapp:latest`
`docker build . -t techchallengeapp:latest`
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"log"
"net/http"

"github.com/servian/TechTestApp/daemon"
"github.com/servian/TechChallengeApp/daemon"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/updatedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package cmd
import (
"fmt"

"github.com/servian/TechTestApp/db"
"github.com/servian/TechChallengeApp/db"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion daemon/deamon.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"os/signal"
"syscall"

"github.com/servian/TechTestApp/ui"
"github.com/servian/TechChallengeApp/ui"
)

// Config - configuration for daemon package
Expand Down
2 changes: 1 addition & 1 deletion db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions doc/config.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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.
More details on each of the configuration values can be found in the section on the configuration file.
36 changes: 18 additions & 18 deletions doc/readme.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -27,7 +27,7 @@ Architectural decisions are recorded in the `adr` folder, details on why can be

Naming convention: `####-<decision title>` 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.

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

Expand Down Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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`
Loading