Skip to content

Commit 7af0b2a

Browse files
authored
feat(container): implement buildpack deploy (#3022)
1 parent 3aa180b commit 7af0b2a

25 files changed

+3821
-1609
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ USAGE:
66
scw container deploy [arg=value ...]
77

88
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-
[build-args.{key}] Build-time variables
14-
[port=8080] Port to expose
15-
[namespace-id] Container Namespace ID to deploy to
16-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
9+
[name] Name of the application (defaults to build-source's directory name)
10+
[builder=paketobuildpacks/builder:base] Builder image to use
11+
[dockerfile=Dockerfile] Path to the Dockerfile
12+
[force-builder=false] Force the use of the builder image (even if a Dockerfile is present)
13+
[build-source=.] Path to the build context
14+
[cache=true] Use cache when building the image
15+
[build-args.{key}] Build-time variables
16+
[port=8080] Port to expose
17+
[namespace-id] Container Namespace ID to deploy to
18+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
1719

1820
FLAGS:
1921
-h, --help help for deploy

docs/commands/container.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,9 @@ scw container deploy [arg=value ...]
350350
| Name | | Description |
351351
|------|---|-------------|
352352
| name | | Name of the application (defaults to build-source's directory name) |
353+
| builder | Default: `paketobuildpacks/builder:base` | Builder image to use |
353354
| dockerfile | Default: `Dockerfile` | Path to the Dockerfile |
355+
| force-builder | Default: `false` | Force the use of the builder image (even if a Dockerfile is present) |
354356
| build-source | Default: `.` | Path to the build context |
355357
| cache | Default: `true` | Use cache when building the image |
356358
| build-args.{key} | | Build-time variables |

go.mod

Lines changed: 104 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ module github.com/scaleway/scaleway-cli/v2
22

33
go 1.19
44

5+
// https://github.com/buildpacks/pack/pull/1735
6+
replace github.com/buildpacks/pack => github.com/quantumsheep/pack v0.30.0-pre1.0.20230505095233-37158bb223a4
7+
58
require (
69
github.com/alecthomas/assert v1.0.0
7-
github.com/c-bata/go-prompt v0.2.5
10+
github.com/buildpacks/pack v0.30.0-pre1.0.20230418191058-1190b6c52128
11+
github.com/c-bata/go-prompt v0.2.6
812
github.com/chzyer/readline v1.5.1
913
github.com/containerd/console v1.0.3
1014
github.com/dnaeon/go-vcr v1.2.0
@@ -32,64 +36,130 @@ require (
3236
)
3337

3438
require (
35-
cloud.google.com/go v0.57.0 // indirect
36-
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
37-
github.com/Microsoft/go-winio v0.5.2 // indirect
39+
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible // indirect
40+
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
41+
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
42+
github.com/Azure/go-autorest/autorest v0.11.28 // indirect
43+
github.com/Azure/go-autorest/autorest/adal v0.9.23 // indirect
44+
github.com/Azure/go-autorest/autorest/azure/auth v0.5.12 // indirect
45+
github.com/Azure/go-autorest/autorest/azure/cli v0.4.6 // indirect
46+
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
47+
github.com/Azure/go-autorest/logger v0.2.1 // indirect
48+
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
49+
github.com/BurntSushi/toml v1.2.1 // indirect
50+
github.com/Masterminds/semver v1.5.0 // indirect
51+
github.com/Microsoft/go-winio v0.6.1 // indirect
52+
github.com/ProtonMail/go-crypto v0.0.0-20230417170513-8ee5748c52b5 // indirect
53+
github.com/acomagu/bufpipe v1.0.4 // indirect
54+
github.com/agext/levenshtein v1.2.3 // indirect
3855
github.com/alecthomas/colour v0.1.0 // indirect
39-
github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142 // indirect
56+
github.com/alecthomas/repr v0.2.0 // indirect
57+
github.com/apex/log v1.9.0 // indirect
58+
github.com/aws/aws-sdk-go-v2 v1.17.8 // indirect
59+
github.com/aws/aws-sdk-go-v2/config v1.18.21 // indirect
60+
github.com/aws/aws-sdk-go-v2/credentials v1.13.20 // indirect
61+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.2 // indirect
62+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.32 // indirect
63+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.26 // indirect
64+
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.33 // indirect
65+
github.com/aws/aws-sdk-go-v2/service/ecr v1.18.9 // indirect
66+
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.16.0 // indirect
67+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.26 // indirect
68+
github.com/aws/aws-sdk-go-v2/service/sso v1.12.8 // indirect
69+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.8 // indirect
70+
github.com/aws/aws-sdk-go-v2/service/sts v1.18.9 // indirect
71+
github.com/aws/smithy-go v1.13.5 // indirect
72+
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20230322223720-077b4a917a90 // indirect
73+
github.com/buildpacks/imgutil v0.0.0-20230420161652-580610d0124b // indirect
74+
github.com/buildpacks/lifecycle v0.17.0-pre.1 // indirect
4075
github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d // indirect
41-
github.com/containerd/containerd v1.6.20 // indirect
42-
github.com/containerd/continuity v0.3.0 // indirect
76+
github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589 // indirect
77+
github.com/cloudflare/circl v1.3.2 // indirect
78+
github.com/containerd/containerd v1.7.0 // indirect
79+
github.com/containerd/continuity v0.3.1-0.20230206214859-2a963a2f56e8 // indirect
80+
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
4381
github.com/containerd/typeurl v1.0.2 // indirect
82+
github.com/containerd/typeurl/v2 v2.1.0 // indirect
4483
github.com/davecgh/go-spew v1.1.1 // indirect
84+
github.com/dimchansky/utfbom v1.1.1 // indirect
85+
github.com/docker/cli v23.0.5+incompatible // indirect
4586
github.com/docker/distribution v2.8.1+incompatible // indirect
87+
github.com/docker/docker-credential-helpers v0.7.0 // indirect
4688
github.com/docker/go-connections v0.4.0 // indirect
4789
github.com/docker/go-units v0.5.0 // indirect
90+
github.com/emirpasic/gods v1.18.1 // indirect
4891
github.com/etdub/goparsetime v0.0.0-20160315173935-ea17b0ac3318 // indirect
49-
github.com/go-logr/logr v1.2.3 // indirect
92+
github.com/gdamore/encoding v1.0.0 // indirect
93+
github.com/gdamore/tcell/v2 v2.6.0 // indirect
94+
github.com/go-git/gcfg v1.5.0 // indirect
95+
github.com/go-git/go-billy/v5 v5.4.1 // indirect
96+
github.com/go-git/go-git/v5 v5.6.1 // indirect
97+
github.com/go-logr/logr v1.2.4 // indirect
5098
github.com/go-logr/stdr v1.2.2 // indirect
5199
github.com/gofrs/flock v0.8.1 // indirect
52100
github.com/gogo/googleapis v1.4.1 // indirect
53101
github.com/gogo/protobuf v1.3.2 // indirect
54-
github.com/golang/protobuf v1.5.2 // indirect
102+
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
103+
github.com/golang/protobuf v1.5.3 // indirect
104+
github.com/google/go-cmp v0.5.9 // indirect
105+
github.com/google/go-containerregistry v0.14.0 // indirect
55106
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
56-
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
57-
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
107+
github.com/google/uuid v1.3.0 // indirect
108+
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
109+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 // indirect
110+
github.com/heroku/color v0.0.6 // indirect
111+
github.com/imdario/mergo v0.3.15 // indirect
58112
github.com/inconshreveable/mousetrap v1.1.0 // indirect
59-
github.com/klauspost/compress v1.15.12 // indirect
60-
github.com/kr/text v0.2.0 // indirect
61-
github.com/mattn/go-runewidth v0.0.9 // indirect
62-
github.com/mattn/go-tty v0.0.3 // indirect
113+
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
114+
github.com/jmespath/go-jmespath v0.4.0 // indirect
115+
github.com/kevinburke/ssh_config v1.2.0 // indirect
116+
github.com/klauspost/compress v1.16.5 // indirect
117+
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
118+
github.com/mattn/go-runewidth v0.0.14 // indirect
119+
github.com/mattn/go-tty v0.0.4 // indirect
120+
github.com/mitchellh/go-homedir v1.1.0 // indirect
121+
github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e // indirect
63122
github.com/moby/patternmatcher v0.5.0 // indirect
64123
github.com/moby/sys/sequential v0.5.0 // indirect
65124
github.com/moby/sys/signal v0.7.0 // indirect
66-
github.com/moby/term v0.0.0-20200312100748-672ec06f55cd // indirect
125+
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
67126
github.com/morikuni/aec v1.0.0 // indirect
68-
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
69127
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect
70-
github.com/opencontainers/runc v1.1.5 // indirect
71-
github.com/pkg/term v1.1.0 // indirect
128+
github.com/opencontainers/runc v1.1.6 // indirect
129+
github.com/opencontainers/selinux v1.11.0 // indirect
130+
github.com/pjbgf/sha1cd v0.3.0 // indirect
131+
github.com/pkg/term v1.2.0-beta.2 // indirect
72132
github.com/pmezard/go-difflib v1.0.0 // indirect
73-
github.com/sergi/go-diff v1.2.0 // indirect
133+
github.com/rivo/tview v0.0.0-20230406072732-e22ce9588bb4 // indirect
134+
github.com/rivo/uniseg v0.4.4 // indirect
135+
github.com/rogpeppe/go-internal v1.10.0 // indirect
136+
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
137+
github.com/sergi/go-diff v1.3.1 // indirect
74138
github.com/sirupsen/logrus v1.9.0 // indirect
75-
github.com/tonistiigi/fsutil v0.0.0-20230105215944-fb433841cbfa // indirect
139+
github.com/skeema/knownhosts v1.1.0 // indirect
140+
github.com/tonistiigi/fsutil v0.0.0-20230407161946-9e7a6df48576 // indirect
76141
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
77142
github.com/tonistiigi/vt100 v0.0.0-20210615222946-8066bb97264f // indirect
78-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.29.0 // indirect
79-
go.opentelemetry.io/otel v1.4.1 // indirect
80-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.1 // indirect
81-
go.opentelemetry.io/otel/sdk v1.4.1 // indirect
82-
go.opentelemetry.io/otel/trace v1.4.1 // indirect
83-
go.opentelemetry.io/proto/otlp v0.12.0 // indirect
84-
golang.org/x/crypto v0.2.0 // indirect
85-
golang.org/x/net v0.7.0 // indirect
143+
github.com/vbatts/tar-split v0.11.3 // indirect
144+
github.com/xanzy/ssh-agent v0.3.3 // indirect
145+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.40.0 // indirect
146+
go.opentelemetry.io/otel v1.14.0 // indirect
147+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 // indirect
148+
go.opentelemetry.io/otel/metric v0.37.0 // indirect
149+
go.opentelemetry.io/otel/sdk v1.14.0 // indirect
150+
go.opentelemetry.io/otel/trace v1.14.0 // indirect
151+
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
152+
golang.org/x/crypto v0.8.0 // indirect
153+
golang.org/x/mod v0.10.0 // indirect
154+
golang.org/x/net v0.9.0 // indirect
86155
golang.org/x/sync v0.1.0 // indirect
87156
golang.org/x/sys v0.8.0 // indirect
88-
golang.org/x/time v0.1.0 // indirect
89-
google.golang.org/genproto v0.0.0-20220706185917-7780775163c4 // indirect
90-
google.golang.org/grpc v1.50.1 // indirect
91-
google.golang.org/protobuf v1.28.1 // indirect
92-
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
157+
golang.org/x/time v0.3.0 // indirect
158+
golang.org/x/tools v0.8.0 // indirect
159+
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
160+
google.golang.org/grpc v1.54.0 // indirect
161+
google.golang.org/protobuf v1.30.0 // indirect
162+
gopkg.in/warnings.v0 v0.1.2 // indirect
93163
gopkg.in/yaml.v2 v2.4.0 // indirect
94164
gotest.tools/v3 v3.4.0 // indirect
95165
)

0 commit comments

Comments
 (0)