Skip to content

Commit a36b432

Browse files
cyclimseyfodil
andauthored
feat(serverless): make run image configurable in container deploy command (#5229)
Co-authored-by: Yacine FODIL <[email protected]> Co-authored-by: Yacine Fodil <[email protected]>
1 parent d4fb5bf commit a36b432

13 files changed

+4472
-13333
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ USAGE:
88
ARGS:
99
[name] Name of the application (defaults to build-source's directory name)
1010
[builder=paketobuildpacks/builder-jammy-base:latest] Builder image to use
11+
[run-image=paketobuildpacks/run-jammy-base:latest] Run image to use
1112
[dockerfile=Dockerfile] Path to the Dockerfile
1213
[force-builder=false] Force the use of the builder image (even if a Dockerfile is present)
1314
[build-source=.] Path to the build context

docs/commands/container.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ scw container deploy [arg=value ...]
361361
|------|---|-------------|
362362
| name | | Name of the application (defaults to build-source's directory name) |
363363
| builder | Default: `paketobuildpacks/builder-jammy-base:latest` | Builder image to use |
364+
| run-image | Default: `paketobuildpacks/run-jammy-base:latest` | Run image to use |
364365
| dockerfile | Default: `Dockerfile` | Path to the Dockerfile |
365366
| force-builder | Default: `false` | Force the use of the builder image (even if a Dockerfile is present) |
366367
| build-source | Default: `.` | Path to the build context |

internal/namespaces/container/v1beta1/custom_deploy.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ type containerDeployRequest struct {
3838
Name string
3939

4040
Builder string
41+
RunImage string
4142
Dockerfile string
4243
ForceBuilder bool
4344

@@ -67,6 +68,11 @@ func containerDeployCommand() *core.Command {
6768
Short: "Builder image to use",
6869
Default: core.DefaultValueSetter("paketobuildpacks/builder-jammy-base:latest"),
6970
},
71+
{
72+
Name: "run-image",
73+
Short: "Run image to use",
74+
Default: core.DefaultValueSetter("paketobuildpacks/run-jammy-base:latest"),
75+
},
7076
{
7177
Name: "dockerfile",
7278
Short: "Path to the Dockerfile",
@@ -372,6 +378,7 @@ func DeployStepBuildpackBuildImage(
372378
AppPath: data.Args.BuildSource,
373379
Builder: data.Args.Builder,
374380
Image: tag,
381+
RunImage: data.Args.RunImage,
375382
ClearCache: !data.Args.Cache,
376383
TrustBuilder: func(string) bool { return true },
377384
})

internal/namespaces/container/v1beta1/testdata/test-deploy-app-name-deduced-from-path.cassette.yaml

Lines changed: 509 additions & 683 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟩🟩🟩 STDOUT️ 🟩🟩🟩️
3-
Your application is now available at https://appclitctnrdeployfpzayj9zdx-app-cli-t-ctnr-deploy-fp.functions.fnc.fr-par.scw.cloud
3+
Your application is now available at https://appclitctnrdeployfpv7kvie1v-app-cli-t-ctnr-deploy-fp.functions.fnc.fr-par.scw.cloud
44

55
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
6-
"Your application is now available at https://appclitctnrdeployfpzayj9zdx-app-cli-t-ctnr-deploy-fp.functions.fnc.fr-par.scw.cloud\n"
6+
"Your application is now available at https://appclitctnrdeployfpv7kvie1v-app-cli-t-ctnr-deploy-fp.functions.fnc.fr-par.scw.cloud\n"

internal/namespaces/container/v1beta1/testdata/test-deploy-build-args.cassette.yaml

Lines changed: 417 additions & 719 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟩🟩🟩 STDOUT️ 🟩🟩🟩️
3-
Your application is now available at https://clitctnrdeploybanaloas4l-cli-t-ctnr-deploy-ba.functions.fnc.fr-par.scw.cloud
3+
Your application is now available at https://clitctnrdeploybao7dknudy-cli-t-ctnr-deploy-ba.functions.fnc.fr-par.scw.cloud
44

55
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
6-
"Your application is now available at https://clitctnrdeploybanaloas4l-cli-t-ctnr-deploy-ba.functions.fnc.fr-par.scw.cloud\n"
6+
"Your application is now available at https://clitctnrdeploybao7dknudy-cli-t-ctnr-deploy-ba.functions.fnc.fr-par.scw.cloud\n"

internal/namespaces/container/v1beta1/testdata/test-deploy-buildpack.cassette.yaml

Lines changed: 2469 additions & 10733 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟩🟩🟩 STDOUT️ 🟩🟩🟩️
3-
Your application is now available at https://clitctnrdeploybp5rwcoxvx-cli-t-ctnr-deploy-bp.functions.fnc.fr-par.scw.cloud
3+
Your application is now available at https://clitctnrdeploybpzlimduyi-cli-t-ctnr-deploy-bp.functions.fnc.fr-par.scw.cloud
44

55
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
6-
"Your application is now available at https://clitctnrdeploybp5rwcoxvx-cli-t-ctnr-deploy-bp.functions.fnc.fr-par.scw.cloud\n"
6+
"Your application is now available at https://clitctnrdeploybpzlimduyi-cli-t-ctnr-deploy-bp.functions.fnc.fr-par.scw.cloud\n"

internal/namespaces/container/v1beta1/testdata/test-deploy-simple.cassette.yaml

Lines changed: 653 additions & 817 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)