Skip to content

Commit b0dd81f

Browse files
committed
Merge branch 'tenants' of github.com:DefangLabs/defang into tenants
2 parents 7ac5df6 + 62a525a commit b0dd81f

File tree

8 files changed

+48
-20
lines changed

8 files changed

+48
-20
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ setup:
1717
go -C src mod tidy
1818

1919
src/README.md: README.md
20-
@awk '/^## Develop Once\. Deploy Anywhere\./{p=1} (/^## /||/^### /){if(p&&!/^## Develop Once\. Deploy Anywhere\./){exit}} p' README.md > src/README.md; \
21-
awk '/^## Defang CLI/{p=1} (/^## /||/^### /){if(p&&!/^## Defang CLI/){exit}} p' README.md >> src/README.md; \
22-
awk '/^## Getting started/{p=1} (/^## /||/^### /){if(p&&!/^## Getting started/){exit}} p' README.md >> src/README.md; \
23-
awk '/^## Support/{p=1} (/^## /||/^### /){if(p&&!/^## Support/){exit}} p' README.md >> src/README.md; \
24-
awk '/^## Environment Variables/{p=1} (/^## /||/^### /){if(p&&!/^## Environment Variables/){exit}} p' README.md >> src/README.md; \
20+
@awk '/^## Develop Once, Deploy Anywhere\./{p=1} (/^## /||/^### /){if(p&&!/^## Develop Once, Deploy Anywhere\./){exit}} p' $< > $@
21+
@awk '/^## Defang CLI/{p=1} (/^## /||/^### /){if(p&&!/^## Defang CLI/){exit}} p' $< >> $@
22+
@awk '/^## Getting started/{p=1} (/^## /||/^### /){if(p&&!/^## Getting started/){exit}} p' $< >> $@
23+
@awk '/^## Support/{p=1} (/^## /||/^### /){if(p&&!/^## Support/){exit}} p' $< >> $@
24+
@awk '/^## Environment Variables/{p=1} (/^## /||/^### /){if(p&&!/^## Environment Variables/){exit}} p' $< >> $@
2525
@echo 'src/README.md was updated because root README.md changed. Please add src/README.md to your commit.';
2626
@false

README.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44

55
### ![Defang](https://raw.githubusercontent.com/DefangLabs/defang-assets/main/Logos/Element_Wordmark_Slogan/JPG/Dark_Colour_Glow.jpg)
66

7-
## Develop Once. Deploy Anywhere.
7+
## Develop Once, Deploy Anywhere.
8+
89
Take your app from Docker Compose to a secure and scalable deployment on your favorite cloud in minutes.
910

1011
## Defang CLI
12+
1113
The Defang Command-Line Interface [(CLI)](https://docs.defang.io/docs/getting-started) is designed for developers who prefer to manage their workflows directly from the terminal. It offers full access to Defang’s capabilities, allowing you to build, test, and deploy applications efficiently to the cloud.
1214

1315
## Defang MCP Server
16+
1417
The Defang Model Context Protocol [(MCP)](https://docs.defang.io/docs/concepts/mcp) Server is tailored for developers who work primarily within integrated development environments (IDEs). It enables seamless cloud deployment from supported editors such as Cursor, Windsurf, VS Code, VS Code Insiders and Claude delivering a fully integrated experience without leaving your development environment.
1518

1619
## This repo includes:
@@ -20,7 +23,6 @@ The Defang Model Context Protocol [(MCP)](https://docs.defang.io/docs/concepts/m
2023
- [Samples](https://github.com/DefangLabs/samples) in Golang, Python, and Node.js that show how to accomplish various tasks and deploy them to the DOP using a Docker Compose file using the Defang CLI.
2124
- Samples that show how to deploy an app using the [Defang Pulumi Provider](https://github.com/DefangLabs/pulumi-defang).
2225

23-
2426
## Getting started
2527

2628
- Read our [Getting Started](https://docs.defang.io/docs/getting-started) page
@@ -33,22 +35,26 @@ The Defang Model Context Protocol [(MCP)](https://docs.defang.io/docs/concepts/m
3335

3436
Install the Defang CLI from one of the following sources:
3537

36-
* Using the [Homebrew](https://brew.sh) package manager [DefangLabs/defang tap](https://github.com/DefangLabs/homebrew-defang):
38+
- Using the [Homebrew](https://brew.sh) package manager [DefangLabs/defang tap](https://github.com/DefangLabs/homebrew-defang):
39+
3740
```
3841
brew install DefangLabs/defang/defang
3942
```
4043

41-
* Using a shell script:
44+
- Using a shell script:
45+
4246
```
4347
eval "$(curl -fsSL s.defang.io/install)"
4448
```
4549

46-
* Using [Go](https://go.dev):
50+
- Using [Go](https://go.dev):
51+
4752
```
4853
go install github.com/DefangLabs/defang/src/cmd/cli@latest
4954
```
5055

51-
* Using the [Nix package manager](https://nixos.org):
56+
- Using the [Nix package manager](https://nixos.org):
57+
5258
- with Nix-Env:
5359
```
5460
nix-env -if https://github.com/DefangLabs/defang/archive/main.tar.gz
@@ -58,23 +64,26 @@ Install the Defang CLI from one of the following sources:
5864
nix profile install github:DefangLabs/defang#defang-bin --refresh
5965
```
6066
61-
* Using [winget](https://learn.microsoft.com/en-us/windows/package-manager/winget/):
67+
- Using [winget](https://learn.microsoft.com/en-us/windows/package-manager/winget/):
68+
6269
```
6370
winget install defang
6471
```
6572
66-
* Using a PowerShell script:
73+
- Using a PowerShell script:
74+
6775
```
6876
iwr https://s.defang.io/defang_win_amd64.zip -OutFile defang.zip
6977
Expand-Archive defang.zip . -Force
7078
```
7179
72-
* Using the [official image from Docker Hub](https://hub.docker.com/r/defangio/defang-cli):
80+
- Using the [official image from Docker Hub](https://hub.docker.com/r/defangio/defang-cli):
81+
7382
```
7483
docker run -it defangio/defang-cli help
7584
```
76-
77-
* or download the [latest binary](https://github.com/DefangLabs/defang/releases/latest/) of the Defang CLI.
85+
86+
- or download the [latest binary](https://github.com/DefangLabs/defang/releases/latest/) of the Defang CLI.
7887
7988
## Support
8089
@@ -145,13 +154,16 @@ The Defang CLI recognizes the following environment variables:
145154
- `TZ` - The timezone to use for log timestamps: an IANA TZ name like `UTC` or `Europe/Amsterdam`; defaults to `Local`
146155
- `XDG_STATE_HOME` - The directory to use for storing state; defaults to `~/.local/state`
147156
157+
Environment variables will be loaded from a `.defangrc` file in the current directory, if it exists. This file follows
158+
the same format as a `.env` file: `KEY=VALUE` pairs on each line, lines starting with `#` are treated as comments and ignored.
159+
148160
## Development
161+
149162
At Defang we use the [Nix package manager](https://nixos.org) for our dev environment, in conjunction with [DirEnv](https://direnv.net).
150163
151164
To get started quickly, install Nix and DirEnv, then create a `.envrc` file to automatically load the Defang developer environment:
165+
152166
```sh
153167
echo use flake >> .envrc
154168
direnv allow
155169
```
156-
157-

pkgs/defang/cli.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildGoModule {
77
pname = "defang-cli";
88
version = "git";
99
src = ../../src;
10-
vendorHash = "sha256-SpV97d+MskTCcdsBYJe/afzxzCo5TUtAef9m+lZT6/o="; # TODO: use fetchFromGitHub
10+
vendorHash = "sha256-0M0jtBaPE1jSx4nrOR4XMw1Im1tMYTKYCkcKiZ1bj8M="; # TODO: use fetchFromGitHub
1111

1212
subPackages = [ "cmd/cli" ];
1313

src/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
## Develop Once. Deploy Anywhere.
1+
## Develop Once, Deploy Anywhere.
2+
23
Take your app from Docker Compose to a secure and scalable deployment on your favorite cloud in minutes.
34

45
## Defang CLI
6+
57
The Defang Command-Line Interface [(CLI)](https://docs.defang.io/docs/getting-started) is designed for developers who prefer to manage their workflows directly from the terminal. It offers full access to Defang’s capabilities, allowing you to build, test, and deploy applications efficiently to the cloud.
68

79
## Getting started
@@ -48,3 +50,6 @@ The Defang CLI recognizes the following environment variables:
4850
- `TZ` - The timezone to use for log timestamps: an IANA TZ name like `UTC` or `Europe/Amsterdam`; defaults to `Local`
4951
- `XDG_STATE_HOME` - The directory to use for storing state; defaults to `~/.local/state`
5052

53+
Environment variables will be loaded from a `.defangrc` file in the current directory, if it exists. This file follows
54+
the same format as a `.env` file: `KEY=VALUE` pairs on each line, lines starting with `#` are treated as comments and ignored.
55+

src/cmd/cli/autoload/load.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package rc
2+
3+
import "github.com/joho/godotenv"
4+
5+
func init() {
6+
godotenv.Load(".defangrc")
7+
}

src/cmd/cli/command/commands.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"time"
1515

1616
"github.com/AlecAivazis/survey/v2"
17+
_ "github.com/DefangLabs/defang/src/cmd/cli/autoload"
1718
"github.com/DefangLabs/defang/src/pkg"
1819
"github.com/DefangLabs/defang/src/pkg/auth"
1920
"github.com/DefangLabs/defang/src/pkg/cli"

src/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ require (
4141
github.com/gorilla/websocket v1.5.0
4242
github.com/hashicorp/go-retryablehttp v0.7.7
4343
github.com/hexops/gotextdiff v1.0.3
44+
github.com/joho/godotenv v1.5.1
4445
github.com/mark3labs/mcp-go v0.29.0
4546
github.com/miekg/dns v1.1.59
4647
github.com/moby/patternmatcher v0.6.0

src/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y
217217
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
218218
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
219219
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
220+
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
221+
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
220222
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
221223
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
222224
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=

0 commit comments

Comments
 (0)