Skip to content

Commit

Permalink
feat(ci): add travis yml config for go
Browse files Browse the repository at this point in the history
progresses #4
  • Loading branch information
catyphram committed Feb 6, 2019
1 parent 214ec80 commit b1cc6ad
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
dist: xenial
matrix:
include:
- language: go
go: "1.11"
before_install:
- cd api
install:
- go get -d -v ./...
before_script:
- mkdir -p ${UNPROCESSED_IMAGES}
script:
- go tool vet .
- go test ./...
env: GO111MODULE=on
services: mongodb
- language: node_js
node_js: "node"
before_install:
- cd client
script:
- yarn lint && yarn test && yarn build
cache: yarn
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Tagallery

[![Build Status](https://travis-ci.org/catyphram/tagallery.svg?branch=master)](https://travis-ci.org/catyphram/tagallery)

Tagallery is an automated image tagging gallery where one can categorize images. To speed up this handy work, a neural network will try to figure out the categories of an image by comparing it with already categorized ones and proposes these cateogries for validation.

**This project is Work In Progress.**
Expand Down Expand Up @@ -29,7 +31,7 @@ The config params can also be set via environment variables.
Go into the `api/` folder and run `go get -d ./...` to download the dependencies, followed by `go build` to compile the executable.
This project is using [Go Modules](https://github.com/golang/go/wiki/Modules), which were introduced with Go v1.11. So, make sure that the project code is outside your `$GOPATH/src`, or set the environment variable `GO111MODULE=on` when running `go get|build|...`.

#### Running
#### Execution

Once built the executable can be started with `./api -c=/path/to/config.json`, or, if using env variables, `UNPROCESSED_IMAGES=/path/to/image/dir PORT=3333 DATABASE=tagallery DATABASE_HOST=localhost:27017 ./api`.

Expand Down
7 changes: 7 additions & 0 deletions api/test/integration_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package test

import (
"time"
"encoding/json"
"fmt"
"io/ioutil"
Expand Down Expand Up @@ -72,7 +73,13 @@ func startAPI() error {
if err != nil {
return err
}

go http.ListenAndServe(fmt.Sprintf(":%v", config.GetConfig().Port), router.CreateRouter())

// Wait 100 milliseconds to ensure that the http server has started
// before the integration tests are run. A race condition may otherwise occur.
time.Sleep(100 * time.Millisecond)

return nil
}

Expand Down
1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"test": "yarn test:unit",
"test:e2e": "vue-cli-service test:e2e",
"test:unit": "vue-cli-service test:unit"
},
Expand Down

0 comments on commit b1cc6ad

Please sign in to comment.