Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more doc to setup development environment section #8

Closed
wants to merge 1 commit into from
Closed
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
35 changes: 32 additions & 3 deletions docs/development/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ Only creating new database migrations requires installing the tool.

## Setup environment

Copy `.env.example` to `.env` and adjust as needed.
We used [`direnv`](direnv.net) to help setup required environment variables.
Copy `.env.example` to `.env` and adjust as needed. Then run it via [`docker-compose`](../../docker-compose.yaml).

To run it without `docker-compose`, we recommend to use [`direnv`](https://github.com/direnv/direnv) to help setup required environment variables. Otherwise, expose `.env` variables to your system environment.

By default, the local data is stored in `data.local`.

And default domain is `http://*.localtest.me:8001` as value of PAGESHIP_HOST_PATTERN set in .env file

## Running in single site mode

```sh
Expand All @@ -34,8 +37,34 @@ Open the sites at `http://localtest.me:8000/` or `http://dev.localtest.me:8000/`

## Running in managed sites mode

method 1: Run with docker-compose

```sh
docker-compose up -d
```

method 2: Run with go command

```sh
go run ./cmd/controller start
```

Setup pageship command to use `http://api.localtest.me:8001` as the API server.
Setup pageship command to use `http://api.localtest.me:8001` as the API server with your github account.

(Note: Must enter absolute path for `SSH Key file`)

```sh
go run ./cmd/pageship login

GitHub user name: <your github user name>
API server: http://api.localtest.me:8001
SSH key file: /Home/yourUsername/.ssh/id_rsa

```

If you enter incorrect info and want to restore whole process please enter command:

```sh
go run ./cmd/pageship config reset

```