Skip to content

Commit

Permalink
use SYNQ-Golang sdk (#16)
Browse files Browse the repository at this point in the history
* update to use more generic circleci name

* redo vendor to base off of SYNQ-Golang SDK with its checked in library

* change markdown

* update vendor.json for new commited Golang SDK changes
  • Loading branch information
batmany13 committed Aug 23, 2017
1 parent d9467bc commit 7c3ccc3
Show file tree
Hide file tree
Showing 6 changed files with 145 additions and 309 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Expand Up @@ -9,12 +9,12 @@ jobs:
- image: library/postgres:9.6.3
environment:
POSTGRES_DB: gosample_test
POSTGRES_USER: gotest
POSTGRES_PASSWORD: gotest
POSTGRES_USER: circleci
POSTGRES_PASSWORD: circleci
environment:
REPO: "gosample"
SYNQ_DIR: "/go/src/github.com/SYNQfm"
PG_USER: "gotest"
PG_USER: "circleci"
PG_DB: "gosample_test"
working_directory: /go/src/github.com/SYNQfm/gosample
steps:
Expand Down
8 changes: 3 additions & 5 deletions README.md
Expand Up @@ -21,8 +21,8 @@ This workspace works! You can check out the test by running
If you want to run it locally, you need to setup the test database

```
createuser -U <postgres admin> -h localhost -P -d gotest
createdb -U gotest -h localhost gosample_test
createuser -U <postgres admin> -h localhost -P -d circleci
createdb -U circleci -h localhost gosample_test
cd sql/environments/test && flyway migrate
```

Expand Down Expand Up @@ -57,12 +57,10 @@ When you copy the workspace the first thing you should do is setup `circleci` an
### Things to change before you start using it

* Go to `.circleci/config.yml` and
* replace `gotest` with the user you want
* replace `gosample_test` with the database you want
* replace `gosample` with the name of your workspace
* Go to `sql/environments/test/flywayconf`
* change the username/password for your app
* change the database
* replace `gosample_test` with database you want
* Change the `sql/migrations/V000__Init.sql` with the table you want
* And of course, change the code as needed, but this workspace starts at 100% code coverage so try to maintain high coverage!

Expand Down
2 changes: 1 addition & 1 deletion main.go
Expand Up @@ -22,7 +22,7 @@ var serverStarted time.Time

const (
DEFAULT_PORT = "41414"
DEFAULT_DB_URL = "postgres://gotest:gotest@localhost:5432/gosample_test?sslmode=disable"
DEFAULT_DB_URL = "postgres://circleci:circleci@localhost:5432/gosample_test?sslmode=disable"
)

type ApiCall struct {
Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Expand Up @@ -246,7 +246,7 @@ func TestParseDbUrl(t *testing.T) {
name = parseDatabaseUrl("postgres://user:password@host.com:5432/dbname?sslmode=disable")
assert.Equal("host=host.com port=5432 dbname=dbname user=user password=password sslmode=disable", name)
name = parseDatabaseUrl(DEFAULT_DB_URL)
assert.Equal("host=localhost port=5432 dbname=gosample_test user=gotest password=gotest sslmode=disable", name)
assert.Equal("host=localhost port=5432 dbname=gosample_test user=circleci password=circleci sslmode=disable", name)
}

func TestMain(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions sql/environments/test/flyway.conf
@@ -1,5 +1,5 @@
flyway.url=jdbc:postgresql://localhost:5432/gosample_test
flyway.schemas=public
flyway.user=gotest
flyway.password=gotest
flyway.user=circleci
flyway.password=circleci
flyway.locations=filesystem:../../migrations

0 comments on commit 7c3ccc3

Please sign in to comment.