Skip to content

Commit c2a7193

Browse files
authored
feat(container): implement deploy workflow (#2872)
1 parent c54f012 commit c2a7193

16 files changed

+3651
-12
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Automatically build and deploy a container.
4+
5+
USAGE:
6+
scw container deploy [arg=value ...]
7+
8+
ARGS:
9+
[name] Name of the application (defaults to build-source's directory name)
10+
[dockerfile=Dockerfile] Path to the Dockerfile
11+
[build-source=.] Path to the build context
12+
[cache=true] Use cache when building the image
13+
[port=8080] Port to expose
14+
[namespace-id] Container Namespace ID to deploy to
15+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
16+
17+
FLAGS:
18+
-h, --help help for deploy
19+
20+
GLOBAL FLAGS:
21+
-c, --config string The path to the config file
22+
-D, --debug Enable debug mode
23+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
24+
-p, --profile string The config profile to use

cmd/scw/testdata/test-all-usage-container-usage.golden

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ AVAILABLE COMMANDS:
1212
namespace Namespace management commands
1313
token Token management commands
1414

15+
WORKFLOW COMMANDS:
16+
deploy Deploy a container
17+
1518
FLAGS:
1619
-h, --help help for container
1720

docs/commands/container.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Containers API.
1616
- [Get a cron](#get-a-cron)
1717
- [List all your crons](#list-all-your-crons)
1818
- [Update an existing cron](#update-an-existing-cron)
19+
- [Deploy a container](#deploy-a-container)
1920
- [Domain management commands](#domain-management-commands)
2021
- [Create a domain name binding](#create-a-domain-name-binding)
2122
- [Delete a domain name binding](#delete-a-domain-name-binding)
@@ -329,6 +330,33 @@ scw container cron update <cron-id ...> [arg=value ...]
329330

330331

331332

333+
## Deploy a container
334+
335+
Automatically build and deploy a container.
336+
337+
Automatically build and deploy a container.
338+
339+
**Usage:**
340+
341+
```
342+
scw container deploy [arg=value ...]
343+
```
344+
345+
346+
**Args:**
347+
348+
| Name | | Description |
349+
|------|---|-------------|
350+
| name | | Name of the application (defaults to build-source's directory name) |
351+
| dockerfile | Default: `Dockerfile` | Path to the Dockerfile |
352+
| build-source | Default: `.` | Path to the build context |
353+
| cache | Default: `true` | Use cache when building the image |
354+
| port | Default: `8080` | Port to expose |
355+
| namespace-id | | Container Namespace ID to deploy to |
356+
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config |
357+
358+
359+
332360
## Domain management commands
333361

334362
Domain management commands.

go.mod

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require (
88
github.com/chzyer/readline v1.5.1
99
github.com/containerd/console v1.0.3
1010
github.com/dnaeon/go-vcr v1.2.0
11+
github.com/docker/docker v23.0.1+incompatible
1112
github.com/dustin/go-humanize v1.0.1
1213
github.com/fatih/color v1.15.0
1314
github.com/getsentry/raven-go v0.2.0
@@ -31,6 +32,8 @@ require (
3132
)
3233

3334
require (
35+
cloud.google.com/go v0.57.0 // indirect
36+
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
3437
github.com/Microsoft/go-winio v0.5.2 // indirect
3538
github.com/alecthomas/colour v0.1.0 // indirect
3639
github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142 // indirect
@@ -40,6 +43,8 @@ require (
4043
github.com/containerd/typeurl v1.0.2 // indirect
4144
github.com/davecgh/go-spew v1.1.1 // indirect
4245
github.com/docker/distribution v2.8.1+incompatible // indirect
46+
github.com/docker/go-connections v0.4.0 // indirect
47+
github.com/docker/go-units v0.5.0 // indirect
4348
github.com/etdub/goparsetime v0.0.0-20160315173935-ea17b0ac3318 // indirect
4449
github.com/go-logr/logr v1.2.3 // indirect
4550
github.com/go-logr/stdr v1.2.2 // indirect
@@ -51,12 +56,18 @@ require (
5156
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
5257
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
5358
github.com/inconshreveable/mousetrap v1.0.1 // indirect
59+
github.com/klauspost/compress v1.15.12 // indirect
60+
github.com/kr/text v0.2.0 // indirect
5461
github.com/mattn/go-runewidth v0.0.9 // indirect
5562
github.com/mattn/go-tty v0.0.3 // indirect
5663
github.com/moby/patternmatcher v0.5.0 // indirect
64+
github.com/moby/sys/sequential v0.5.0 // indirect
5765
github.com/moby/sys/signal v0.7.0 // indirect
66+
github.com/moby/term v0.0.0-20200312100748-672ec06f55cd // indirect
5867
github.com/morikuni/aec v1.0.0 // indirect
68+
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
5969
github.com/opencontainers/image-spec v1.0.3-0.20220303224323-02efb9a75ee1 // indirect
70+
github.com/opencontainers/runc v1.1.3 // indirect
6071
github.com/pkg/term v1.1.0 // indirect
6172
github.com/pmezard/go-difflib v1.0.0 // indirect
6273
github.com/sergi/go-diff v1.2.0 // indirect
@@ -71,12 +82,14 @@ require (
7182
go.opentelemetry.io/otel/trace v1.4.1 // indirect
7283
go.opentelemetry.io/proto/otlp v0.12.0 // indirect
7384
golang.org/x/crypto v0.2.0 // indirect
74-
golang.org/x/net v0.7.0 // indirect
85+
golang.org/x/net v0.4.0 // indirect
7586
golang.org/x/sync v0.1.0 // indirect
7687
golang.org/x/sys v0.6.0 // indirect
7788
golang.org/x/time v0.1.0 // indirect
7889
google.golang.org/genproto v0.0.0-20220706185917-7780775163c4 // indirect
7990
google.golang.org/grpc v1.50.1 // indirect
8091
google.golang.org/protobuf v1.28.1 // indirect
92+
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
8193
gopkg.in/yaml.v2 v2.4.0 // indirect
94+
gotest.tools/v3 v3.4.0 // indirect
8295
)

0 commit comments

Comments
 (0)