Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.
This repository was archived by the owner on Sep 2, 2022. It is now read-only.

Local Workflow #714

@timsuchanek

Description

@timsuchanek

Local Development

We will enable a local development workflow using docker under the hood.
The topic this proposal is shedding light on is how that exactly looks like in the CLI.

Commands

gc local up: Pull & Start a local Graphcool instance
gc local start: Start an already intialized local Graphcool instance
gc local pull: Pull the latest Graphcool version
gc local stop: Stop the currently running local Graphcool instance
gc local reset: Reset the local Project

.graphcoolrc

The .graphcoolrc would get a new "kind" of environment, called local:

default: dev
environments:
  prod: cj7zy085306i50193k7ox16z4
  dev: local

~/.graphcool

{
  "token": "...",
  "local_token": "...",
  "local_host": "localhost:60000"
}

So additionaly to token, there will also be local_token and local_host.
These values all can be overwritten by environment variables:

export GRAPHCOOL_TOKEN=...
export GRAPHCOOL_LOCAL_TOKEN=...
export GRAPHCOOL_LOCAL_HOST=...

There can be one local environment at the same time. When multiple local environments are needed, that orchestration can be achieved with managing the environment variables.

Update:

Add gc local restart command.

Update 2:

As @kbrandwijk suggested, it makes more sense for the local docker environment information to live in the .graphcoolrc file and not the .graphcool file as .graphcool is global and the local docker env information is project related.
With this change the files look as follows:

.graphcoolrc

default: dev
environments:
  prod: cj7zy085306i50193k7ox16z4
  dev:
    token: "..."
    host: "localhost:60000"
    projectId: c27zs08d30ai52683k7mx26a5 # temporary, will be removed soon

~/.graphcool

{
  "token": "..."
}

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions