Skip to content

Commit

Permalink
Devbox runtime support release command and args (#5078)
Browse files Browse the repository at this point in the history
* add release command and args for release default commands.

* add default workingDir

* add make pre-deploy
  • Loading branch information
lingdie committed Sep 13, 2024
1 parent 6338cf8 commit bf2fe19
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
8 changes: 8 additions & 0 deletions controllers/devbox/api/v1alpha1/runtime_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,18 @@ type Config struct {
// kubebuilder:validation:Optional
Args []string `json:"args,omitempty"`
// +kubebuilder:validation:Optional
// +kubebuilder:default=/home/sealos/project
WorkingDir string `json:"workingDir,omitempty"`
// +kubebuilder:validation:Optional
Env []corev1.EnvVar `json:"env,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default={/bin/bash,-c}
ReleaseCommand []string `json:"releaseCommand,omitempty"`
// +kubebuilder:validation:Optional
// +kubebuilder:default={/home/sealos/project/entrypoint.sh}
ReleaseArgs []string `json:"releaseArgs,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default={{name:"devbox-ssh-port",containerPort:22,protocol:TCP}}
Ports []corev1.ContainerPort `json:"ports,omitempty"`
Expand Down
14 changes: 14 additions & 0 deletions controllers/devbox/config/crd/bases/devbox.sealos.io_runtimes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,19 @@ spec:
- containerPort
type: object
type: array
releaseArgs:
default:
- /home/sealos/project/entrypoint.sh
items:
type: string
type: array
releaseCommand:
default:
- /bin/bash
- -c
items:
type: string
type: array
user:
default: sealos
type: string
Expand Down Expand Up @@ -1902,6 +1915,7 @@ spec:
type: object
type: array
workingDir:
default: /home/sealos/project
type: string
required:
- image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ spec:
description: go1.22.5
config:
image: ghcr.io/cbluebird/devbox/go1.22.5:2f4067
workingDir: /home/sealos/project
releaseCommand:
- /bin/bash
- -c
releaseArgs:
- /home/sealos/project/entrypoint.sh
category:
- ubuntu
- go
Expand Down
14 changes: 14 additions & 0 deletions controllers/devbox/deploy/manifests/deploy.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3230,6 +3230,19 @@ spec:
- containerPort
type: object
type: array
releaseArgs:
default:
- /home/sealos/project/entrypoint.sh
items:
type: string
type: array
releaseCommand:
default:
- /bin/bash
- -c
items:
type: string
type: array
user:
default: sealos
type: string
Expand Down Expand Up @@ -4885,6 +4898,7 @@ spec:
type: object
type: array
workingDir:
default: /home/sealos/project
type: string
required:
- image
Expand Down

0 comments on commit bf2fe19

Please sign in to comment.