|
1 |
| -[](https://github.com/coder/coder/actions/workflows/coder.yaml) |
2 |
| -[](https://codecov.io/gh/coder/coder) |
| 1 | +# Coder |
3 | 2 |
|
4 |
| -# Coder v2 |
| 3 | +[](https://github.com/coder/coder/discussions) [](https://coder.com/community) [](https://twitter.com/coderhq) [](https://codecov.io/gh/coder/coder) |
5 | 4 |
|
6 |
| -This repository contains source code for Coder V2. Additional documentation: |
| 5 | +Provision remote development environments with Terraform. |
7 | 6 |
|
8 |
| -- [Workspaces V2 RFC](https://www.notion.so/coderhq/b48040da8bfe46eca1f32749b69420dd?v=a4e7d23495094644b939b08caba8e381&p=e908a8cd54804ddd910367abf03c8d0a) |
| 7 | +## Highlights |
9 | 8 |
|
10 |
| -## Directory Structure |
| 9 | +- Automate development environments for Linux, Windows, and MacOS in your cloud |
| 10 | +- Start writing code with a single command |
| 11 | +- Use one of many [examples](./examples) to get started |
11 | 12 |
|
12 |
| -- `.github/`: Settings for [Dependabot for updating dependencies](https://docs.github.com/en/code-security/supply-chain-security/customizing-dependency-updates) and [build/deploy pipelines with GitHub Actions](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions). |
13 |
| - - [`semantic.yaml`](./github/semantic.yaml): Configuration for [semantic pull requests](https://github.com/apps/semantic-pull-requests) |
14 |
| -- `examples`: Example terraform project templates. |
15 |
| -- `site`: Front-end UI code. |
| 13 | +## Getting Started |
16 | 14 |
|
17 |
| -## Development |
18 |
| - |
19 |
| -### Pre-requisites |
20 |
| - |
21 |
| -- `git` |
22 |
| -- `go` version 1.17, with the `GOPATH` environment variable set |
23 |
| -- `node` |
24 |
| -- `yarn` |
25 |
| - |
26 |
| -### Cloning |
27 |
| - |
28 |
| -- `git clone https://github.com/coder/coder` |
29 |
| -- `cd coder` |
30 |
| - |
31 |
| -### Building |
32 |
| - |
33 |
| -- `make build` |
34 |
| -- `make install` |
| 15 | +Install [the latest release](https://github.com/coder/coder/releases). |
35 | 16 |
|
36 |
| -The `coder` CLI binary will now be available at `$GOPATH/bin/coder` |
| 17 | +To tinker, start with dev-mode (all data is in-memory, and is destroyed on exit): |
37 | 18 |
|
38 |
| -### Running |
| 19 | +```bash |
| 20 | +$ coder start --dev |
| 21 | +``` |
39 | 22 |
|
40 |
| -After building, the binaries will be available at: |
41 |
| -- `dist/coder_{os}_{arch}/coder` |
| 23 | +To run a production deployment with PostgreSQL: |
42 | 24 |
|
43 |
| -For the purpose of these steps, an OS of `linux` and an arch of `amd64` is assumed. |
| 25 | +```bash |
| 26 | +$ CODER_PG_CONNECTION_URL="postgres://<username>@<host>/<database>?password=<password>" \ |
| 27 | + coder start |
| 28 | +``` |
44 | 29 |
|
45 |
| -To manually run the server and go through first-time set up, run the following commands in separate terminals: |
46 |
| -- `dist/coder_linux_amd64/coder daemon` <-- starts the Coder server on port 3000 |
47 |
| -- `dist/coder_linux_amd64/coder login http://localhost:3000` <-- runs through first-time setup, creating a user and org |
| 30 | +To run as a system service, install with `.deb` or `.rpm`: |
48 | 31 |
|
49 |
| -You'll now be able to login and access the server. |
| 32 | +```bash |
| 33 | +# Edit the configuration! |
| 34 | +$ sudo vim /etc/coder.d/coder.env |
| 35 | +$ sudo service coder restart |
| 36 | +``` |
50 | 37 |
|
51 |
| -- `dist/coder_linux_amd64/coder projects create -d /path/to/project` |
| 38 | +### Your First Workspace |
52 | 39 |
|
53 |
| -### Development |
| 40 | +In a new terminal, create a new project (eg. Develop in Linux on Google Cloud): |
54 | 41 |
|
55 |
| -- `./develop.sh` |
| 42 | +``` |
| 43 | +$ coder projects init |
| 44 | +$ coder projects create |
| 45 | +``` |
56 | 46 |
|
57 |
| -The `develop.sh` script does three things: |
| 47 | +Create a new workspace and SSH in: |
58 | 48 |
|
59 |
| -- runs `coder daemon` locally on port `3000` |
60 |
| -- runs `webpack-dev-server` on port `8080` |
61 |
| -- sets up an initial user and organization |
| 49 | +``` |
| 50 | +$ coder workspaces create my-first-workspace |
| 51 | +$ coder ssh my-first-workspace |
| 52 | +``` |
62 | 53 |
|
63 |
| -This is the recommend flow for working on the front-end, as hot-reload is set up as part of the webpack config. |
64 |
| - |
65 |
| -Note that `./develop.sh` creates a user and allows you to log into the UI, but does not log you into the CLI, which is required for creating a project. Use the `login` command above before the `projects create` command. |
66 |
| - |
67 |
| -While we're working on automating XState typegen, you may need to run `yarn typegen` from `site`. |
68 |
| - |
69 |
| -## Front-End Plan |
70 |
| - |
71 |
| -For the front-end team, we're planning on 2 phases to the 'v2' work: |
72 |
| - |
73 |
| -### Phase 1 |
74 |
| - |
75 |
| -Phase 1 is the 'new-wine-in-an-old-bottle' approach - we want to preserve the look and feel (UX) of v1, while testing and validating the market fit of our new v2 provisioner model. This means that we'll preserve Material UI and re-use components from v1 (porting them over to the v2 codebase). |
| 54 | +## Development |
76 | 55 |
|
77 |
| -### Phase 2 |
| 56 | +The code structure is inspired by [Basics of Unix Philosophy](https://homepage.cs.uri.edu/~thenry/resources/unix_art/ch01s06.html) and [Effective Go](https://go.dev/doc/effective_go). |
78 | 57 |
|
79 |
| -Phase 2 is the 'new-wine-in-a-new-bottle' - which we can do once we've successfully packaged the new wine in the old bottle. |
| 58 | +Coder requires Go 1.18+, Node 14+, and GNU Make. |
80 | 59 |
|
81 |
| -In other words, once we've validated that the new strategy fits and is desirable for our customers, we'd like to build a new, v2-native UI (leveraging designers on the team to build a first-class experience around the new provisioner model). |
| 60 | +- `make bin` builds binaries |
| 61 | +- `make install` installs binaries to `$GOPATH/bin` |
| 62 | +- `make test` |
| 63 | +- `make release` dry-runs a new release |
| 64 | +- `./develop.sh` hot-reloads for frontend development |
0 commit comments