Making local tests runnable (#157)

* 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
This commit is contained in:
Aaron Schlesinger
2018-06-06 12:42:16 -07:00
committed by GitHub
parent 38a9ff3b87
commit f08d3138bc
8 changed files with 29 additions and 31 deletions
+16 -20
View File
@@ -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/olympus
buffalo dev
```
... and the following to run [Athens](https://github.com/gomods/athens/wiki/Proxies-(Athens):
```console
cd cmd/proxy
buffalo dev
```
You'll see some output in your console that looks like this:
```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…
```
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
@@ -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 |
|---|---:|
+1
View File
@@ -0,0 +1 @@
ATHENS_MONGO_STORAGE_URL=mongodb://127.0.0.1:27017
+3 -3
View File
@@ -1,8 +1,8 @@
development:
dialect: "mysql"
database: olympusdb
database: athens
host: 127.0.0.1
port: 3307
port: 3306
user: vgp
password: vgp
@@ -16,7 +16,7 @@ test_postgres:
test:
dialect: "mysql"
database: olympusdb
database: athens
host: 127.0.0.1
port: 3306
user: vgp
+2 -2
View File
@@ -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
@@ -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
View File
@@ -0,0 +1 @@
ATHENS_MONGO_STORAGE_URL=mongodb://127.0.0.1:27017
+3 -3
View File
@@ -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
+2 -2
View File
@@ -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
@@ -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
+1 -1
View File
@@ -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: