website/content/articles/getting-started.md

72 lines
1.5 KiB
Markdown
Raw Normal View History

2020-07-30 02:01:40 +00:00
---
title: "Getting Started"
2022-09-25 07:23:44 +00:00
date: 2022-09-10T11:29:09-04:00
2020-07-30 02:01:40 +00:00
description: "A quick setup guide to get a server running"
draft: false
2022-09-25 07:23:44 +00:00
version: "2.0.0"
2020-07-30 02:01:40 +00:00
---
# Setting up a project
To setup a project for conductor you need to create a `conductor.yaml` somewhere in your project tree.
We will assume you have a stack that consists of 2 seperate components in a directory structure that looks
like this:
```sh
/project
/frontend/
/backend/
/support_service/
```
## Settting up a conductor.yml
Conductor will search for a `conductor.yaml` anywhere in or above the current working directory. We will put the configuration
in the root `/project/` folder so it is accessible from any of the component projects.
{{< infobox >}}
For more information see the full <a ui button right floated" href="/articles/config">Config documentation</a>
{{< /infobox >}}
2022-09-25 07:23:44 +00:00
An example of a configuration file could look like this:
2020-07-30 02:01:40 +00:00
```yaml
2022-09-25 07:23:44 +00:00
groups:
dev:
components:
- frontend
- backend
- support
2020-07-30 02:01:40 +00:00
components:
2022-09-25 07:23:44 +00:00
frontend:
env:
API_URL: http://localhost:4000
comamnd: npm start
backend:
env:
DATABSE_URL: mysql://devserver/app-dev
HTTP_PORT: 4000
command: cargo run
support:
command: python main.py
2020-07-30 02:01:40 +00:00
```
Now from the project folder or any folder below it we can launch all 3 components using:
```sh
2022-09-25 07:23:44 +00:00
conductor dev
2020-07-30 02:01:40 +00:00
```
2022-09-25 07:23:44 +00:00
Running a single component:
2020-07-30 02:01:40 +00:00
```sh
conductor backend
```
2022-09-25 07:23:44 +00:00
Running multiple specific components:
```sh
conductor frnotend backend
```