Skip to content

Commit

Permalink
feat: add multi-repo support
Browse files Browse the repository at this point in the history
  • Loading branch information
eysi09 committed Aug 10, 2018
1 parent aa83d7f commit 740e858
Show file tree
Hide file tree
Showing 95 changed files with 2,959 additions and 945 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[![CircleCI](https://circleci.com/gh/garden-io/garden/tree/master.svg?style=svg&circle-token=ac1ec9984d093f91e594e5a0a03b34cec2c2a093)](https://circleci.com/gh/garden-io/garden/tree/master)


![](docs/garden-banner-logotype-left-2.png)

*Welcome! Garden is a full-featured development framework for containers and serverless backends, designed to make
it easy to develop and test distributed systems.*
*Welcome! Garden is a full-featured development framework for containers and serverless backends, designed to make
it easy to develop and test distributed systems.*
<br><br>

### Status
Expand All @@ -16,7 +16,6 @@ All that said, Garden can already be highly useful if the following applies to y

* **You're deploying to (or transitioning to) Kubernetes.**
* **You work mostly with containers** _**today**_ _\(but perhaps plan on adopting serverless platforms in the future\)._
* **You keep all your services in a single repository** _(multi-repo support coming soon!)._
* **You really don't want to spend your precious hours building your own developer tooling!**

If that sounds right for you, please give it a go and don't hesitate to report issues.
Expand All @@ -34,8 +33,8 @@ With Garden, you can...
* Leverage a suite of commands and helpers to facilitate developing and running your stack.
* _Write code the way you want, and run your production system however suits you! Garden does not impose any new libraries or languages aside from the config files._

Garden is also designed to be pluggable and modular, with Kubernetes being just one plugin (albeit an important one).
Over time we will add native support for a variety of platforms, including AWS (Lambda, ECS, Fargate and more),
Garden is also designed to be pluggable and modular, with Kubernetes being just one plugin (albeit an important one).
Over time we will add native support for a variety of platforms, including AWS (Lambda, ECS, Fargate and more),
GCP, Heroku, OpenFaaS... and the list will continue growing.

Please read the [Motivation](https://docs.garden.io/introduction/motivation) section in our documentation
Expand All @@ -51,8 +50,8 @@ guide to get a quick sense of how it works.

## Contributing

We welcome any and all contributions to Garden! What we're trying to achieve is a big task, and
developers have a lot of diverse needs, so we need and appreciate your input, whether it's through
We welcome any and all contributions to Garden! What we're trying to achieve is a big task, and
developers have a lot of diverse needs, so we need and appreciate your input, whether it's through
code, docs, issues or developing plugins for your needs.

For more detailed guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md).
Expand Down
159 changes: 158 additions & 1 deletion docs/reference/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Examples:

| Argument | Alias | Type | Description |
| -------- | ----- | ---- | ----------- |
| `--module-dirs` | | string | Relative path to modules directory. Use comma as a separator to specify multiple directories
| `--module-dirs` | | array:path | Relative path to modules directory. Use comma as a separator to specify multiple directories
| `--name` | | string | Assigns a custom name to the project. (Defaults to name of the current directory.)

### garden create module
Expand Down Expand Up @@ -306,6 +306,52 @@ Examples:
| -------- | ----- | ---- | ----------- |
| `--force` | | boolean | Force initalization of environment, ignoring the environment status check.

### garden link source

Link a remote source to a local directory.

After linking a remote source, Garden will read it from its local directory instead of
from the remote URL. Garden can only link remote sources that have been declared in the project
level garden.yml config.

Examples:

garden link source my-source path/to/my-source # links my-source to its local version at the given path

##### Usage

garden link source <source> <path>

##### Arguments

| Argument | Required | Description |
| -------- | -------- | ----------- |
| `source` | Yes | Name of the source to link as declared in the project config.
| `path` | Yes | Path to the local directory that containes the source.

### garden link module

Link a module to a local directory.

After linking a remote module, Garden will read the source from the module's local directory instead of from
the remote URL. Garden can only link modules that have a remote source,
i.e. modules that specifiy a repositoryUrl in their garden.yml config file.

Examples:

garden link module my-module path/to/my-module # links my-module to its local version at the given path

##### Usage

garden link module <module> <path>

##### Arguments

| Argument | Required | Description |
| -------- | -------- | ----------- |
| `module` | Yes | Name of the module to link.
| `path` | Yes | Path to the local directory that containes the module.

### garden login

Log into configured providers for this project and environment.
Expand Down Expand Up @@ -548,6 +594,117 @@ Test all or specified modules.
| `--force-build` | | boolean | Force rebuild of module(s).
| `--watch` | `-w` | boolean | Watch for changes in module(s) and auto-test.

### garden unlink source

Unlink a previously linked remote source from its local directory.

After unlinking a remote source, Garden will go back to reading it from its remote URL instead
of its local directory.

Examples:

garden unlink source my-source # unlinks my-source
garden unlink source --all # unlinks all sources

##### Usage

garden unlink source [source] [options]

##### Arguments

| Argument | Required | Description |
| -------- | -------- | ----------- |
| `source` | No | Name of the source(s) to unlink. Use comma separator to specify multiple sources.

##### Options

| Argument | Alias | Type | Description |
| -------- | ----- | ---- | ----------- |
| `--all` | `-a` | boolean | Unlink all sources.

### garden unlink module

Unlink a previously linked remote module from its local directory.

After unlinking a remote module, Garden will go back to reading the module's source from
its remote URL instead of its local directory.

Examples:

garden unlink module my-module # unlinks my-module
garden unlink module --all # unlink all modules

##### Usage

garden unlink module [module] [options]

##### Arguments

| Argument | Required | Description |
| -------- | -------- | ----------- |
| `module` | No | Name of the module(s) to unlink. Use comma separator to specify multiple modules.

##### Options

| Argument | Alias | Type | Description |
| -------- | ----- | ---- | ----------- |
| `--all` | `-a` | boolean | Unlink all modules.

### garden update-remote sources

Update remote sources.

Update the remote sources declared in the project config.

Examples:

garden update-remote sources # update all remote sources in the project config
garden update-remote sources my-source # update remote source my-source

##### Usage

garden update-remote sources [source]

##### Arguments

| Argument | Required | Description |
| -------- | -------- | ----------- |
| `source` | No | Name of the remote source(s) to update. Use comma separator to specify multiple sources.

### garden update-remote modules

Update remote modules.

Remote modules are modules that have a repositoryUrl field
in their garden.yml config that points to a remote repository.

Examples:

garden update-remote modules # update all remote modules in the project
garden update-remote modules my-module # update remote module my-module

##### Usage

garden update-remote modules [module]

##### Arguments

| Argument | Required | Description |
| -------- | -------- | ----------- |
| `module` | No | Name of the remote module(s) to update. Use comma separator to specify multiple modules.

### garden update-remote all

Update all remote sources and modules.

Examples:

garden update-remote all # update all remote sources and modules in the project

##### Usage

garden update-remote all

### garden validate

Check your garden configuration for errors.
Expand Down
70 changes: 58 additions & 12 deletions docs/reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,24 @@ module:
# Required.
type:

# Valid RFC1035/RFC1123 (DNS) label (may contain lowercase letters, numbers and dashes, must
# start with a letter, and cannot end with a dash) and additionally cannot contain consecutive
# dashes or be longer than 63 characters.
# The name of this module.
#
# Optional.
# Example: "my-sweet-module"
#
# Required.
name:

description:

# A remote repository URL to fetch the module from. Garden will read the garden.yml config from
# the local module. Currently only supports git servers.
#
# Example: "<git remote url>#<branch|tag> or
# git+https://github.com/organization/some-module.git#v2.0"
#
# Optional.
repositoryUrl:

# Variables that this module can reference and expose as environment variables.
#
# Example:
Expand Down Expand Up @@ -187,6 +196,25 @@ project:
# Required.
name:


# A list of remote sources to import into project
#
# Optional.
sources:
- # The name of the source to import
#
# Required.
name:

# A remote respository URL. Currently only supports git servers. Use hash notation (#) to
# point to a specific branch or tag
#
# Example: "<git remote url>#<branch|tag> or
# git+https://github.com/organization/some-module.git#v2.0"
#
# Required.
repositoryUrl:

```

## Built-in module types
Expand All @@ -206,15 +234,24 @@ module:
# Required.
type:

# Valid RFC1035/RFC1123 (DNS) label (may contain lowercase letters, numbers and dashes, must
# start with a letter, and cannot end with a dash) and additionally cannot contain consecutive
# dashes or be longer than 63 characters.
# The name of this module.
#
# Optional.
# Example: "my-sweet-module"
#
# Required.
name:

description:

# A remote repository URL to fetch the module from. Garden will read the garden.yml config from
# the local module. Currently only supports git servers.
#
# Example: "<git remote url>#<branch|tag> or
# git+https://github.com/organization/some-module.git#v2.0"
#
# Optional.
repositoryUrl:

# Variables that this module can reference and expose as environment variables.
#
# Example:
Expand Down Expand Up @@ -336,15 +373,24 @@ module:
# Required.
type:

# Valid RFC1035/RFC1123 (DNS) label (may contain lowercase letters, numbers and dashes, must
# start with a letter, and cannot end with a dash) and additionally cannot contain consecutive
# dashes or be longer than 63 characters.
# The name of this module.
#
# Optional.
# Example: "my-sweet-module"
#
# Required.
name:

description:

# A remote repository URL to fetch the module from. Garden will read the garden.yml config from
# the local module. Currently only supports git servers.
#
# Example: "<git remote url>#<branch|tag> or
# git+https://github.com/organization/some-module.git#v2.0"
#
# Optional.
repositoryUrl:

# Variables that this module can reference and expose as environment variables.
#
# Example:
Expand Down
2 changes: 1 addition & 1 deletion garden-cli/gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ gulp.task("add-version-files", async () => {
const versionFilePath = resolve(path, ".garden-version")

const vcsHandler = new GitHandler(path)
const treeVersion = await vcsHandler.getTreeVersion([path])
const treeVersion = await vcsHandler.getTreeVersion(path)

await writeFile(versionFilePath, JSON.stringify(treeVersion, null, 4) + "\n")
})
Expand Down
16 changes: 16 additions & 0 deletions garden-cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions garden-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"moment": "^2.22.2",
"node-emoji": "^1.8.1",
"node-pty": "^0.7.4",
"path-is-inside": "^1.0.2",
"shx": "^0.3.2",
"snyk": "^1.82.2",
"split": "^1.0.1",
Expand Down Expand Up @@ -91,6 +92,7 @@
"@types/nock": "^9.1.3",
"@types/node": "^10.3.2",
"@types/node-emoji": "^1.8.0",
"@types/path-is-inside": "^1.0.0",
"@types/prettyjson": "0.0.28",
"@types/uniqid": "^4.1.2",
"@types/wrap-ansi": "^3.0.0",
Expand Down
Loading

0 comments on commit 740e858

Please sign in to comment.