Skip to content

Commit

Permalink
Making local tests runnable (gomods#157)
Browse files Browse the repository at this point in the history
* using the right DB names in the proxy database file

* using the right DB names in the olympus database file

and the right ports

* using the right DB name in the docker-compose

* adding mongo URL to the buffalo env file

* adding mongo URL to the proxy env file

* updating port for the proxy DB

* updating DB schemas for olympus and the proxy

* making the readme a little more up to date
  • Loading branch information
arschles authored Jun 6, 2018
1 parent 38a9ff3 commit f08d313
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 28 deletions.
30 changes: 13 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,23 @@ Athens is composed roughly of three logical pieces. The below list contains link
The server is written using [Buffalo](https://gobuffalo.io/), so it's fairly straightforward
to get started on development. You'll need Buffalo v0.11.0 or later to do development on Athens.

Download [v0.11.0](https://github.com/gobuffalo/buffalo/releases/tag/v0.11.0) or later, untar/unzip the binary into your PATH, and then run the following from the root of this repository:
Download [v0.11.0](https://github.com/gobuffalo/buffalo/releases/tag/v0.11.0) or later, untar/unzip the binary into your PATH, and then run the
following to run [Olympus](https://github.com/gomods/athens/wiki/The-Central-Package-Registry-(Olympus)):

```console
cd cmd/proxy
cd cmd/olympus
buffalo dev
```

You'll see some output in your console that looks like this:
... and the following to run [Athens](https://github.com/gomods/athens/wiki/Proxies-(Athens):

```console
$ buffalo dev
buffalo: 2018/02/25 16:09:36 === Rebuild on: :start: ===
buffalo: 2018/02/25 16:09:36 === Running: go build -v -i -o tmp/vgoprox-build (PID: 94067) ===
buffalo: 2018/02/25 16:09:37 === Building Completed (PID: 94067) (Time: 1.115613079s) ===
buffalo: 2018/02/25 16:09:37 === Running: tmp/vgoprox-build (PID: 94078) ===
time="2018-02-25T16:09:37-08:00" level=info msg="Starting application at 127.0.0.1:3000" INFO[2018-02-25T16:09:37-08:00] Starting Simple Background Worker Webpack is watching the files…
cd cmd/proxy
buffalo dev
```

After the `Starting application at 127.0.0.1:3000` is logged, the server is up and running.
As you edit and save code, Buffalo will automatically restart the server. **This means that
all of your modules will disappear** because the only storage driver is in-memory right now.

See [CLI](./CLI.md) for information on how to add modules back into the server.
After you see something like `Starting application at 127.0.0.1:3000`, the server
is up and running. As you edit and save code, Buffalo will automatically restart the server.

## Dependencies and Set-up

Expand All @@ -50,16 +44,18 @@ development environments.
To create, run the following from the repository root:

```console
docker-compose up -d
docker-compose -p athens up -d
```

To destroy:

```console
docker-compose down
docker-compose -p athens down
```

A few environment variables are expected by the application and tests.
A few environment variables are expected by the application and tests. They are
stored in `cmd/olympus/.env` and `cmd/proxy/.env`. Below is a table of the
default values:

|Variable |Value |
|---|---:|
Expand Down
1 change: 1 addition & 0 deletions cmd/olympus/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ATHENS_MONGO_STORAGE_URL=mongodb://127.0.0.1:27017
6 changes: 3 additions & 3 deletions cmd/olympus/database.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
development:
dialect: "mysql"
database: olympusdb
database: athens
host: 127.0.0.1
port: 3307
port: 3306
user: vgp
password: vgp

Expand All @@ -16,7 +16,7 @@ test_postgres:

test:
dialect: "mysql"
database: olympusdb
database: athens
host: 127.0.0.1
port: 3306
user: vgp
Expand Down
4 changes: 2 additions & 2 deletions cmd/olympus/migrations/schema.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
--
-- Host: 127.0.0.1 Database: vgoprox
-- Host: 127.0.0.1 Database: athens
-- ------------------------------------------------------
-- Server version 5.7.21

Expand Down Expand Up @@ -37,4 +37,4 @@ CREATE TABLE `schema_migration` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2018-03-21 16:06:17
-- Dump completed on 2018-06-06 12:17:16
1 change: 1 addition & 0 deletions cmd/proxy/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ATHENS_MONGO_STORAGE_URL=mongodb://127.0.0.1:27017
6 changes: 3 additions & 3 deletions cmd/proxy/database.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
development:
dialect: "mysql"
database: olympusdb
database: athens
host: 127.0.0.1
port: 3307
port: 3306
user: vgp
password: vgp

test:
dialect: "mysql"
database: olympusdb
database: athens
host: 127.0.0.1
port: 3306
user: vgp
Expand Down
4 changes: 2 additions & 2 deletions cmd/proxy/migrations/schema.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- MySQL dump 10.13 Distrib 5.7.21, for osx10.13 (x86_64)
--
-- Host: 127.0.0.1 Database: vgoprox
-- Host: 127.0.0.1 Database: athens
-- ------------------------------------------------------
-- Server version 5.7.21

Expand Down Expand Up @@ -37,4 +37,4 @@ CREATE TABLE `schema_migration` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2018-03-21 16:06:17
-- Dump completed on 2018-06-06 12:32:35
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
- "ALLOW_EMPTY_PASSWORD=yes"
- "MYSQL_USER=vgp"
- "MYSQL_PASSWORD=vgp"
- "MYSQL_DATABASE=vgoprox"
- "MYSQL_DATABASE=athens"
postgres:
image: postgres:9.6.9-alpine
ports:
Expand Down

0 comments on commit f08d313

Please sign in to comment.