osbuild2: new stages
org.osbuild.chmod: runs chmod on one or more files org.osbuild.nginx.conf: write nginx config file Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
This commit is contained in:
parent
6abb4b9af6
commit
a717a7245b
2 changed files with 52 additions and 0 deletions
20
internal/osbuild2/chmod_stage.go
Normal file
20
internal/osbuild2/chmod_stage.go
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
package osbuild2
|
||||
|
||||
type ChmodStageOptions struct {
|
||||
Items map[string]ChmodStagePathOptions `json:"items"`
|
||||
}
|
||||
|
||||
type ChmodStagePathOptions struct {
|
||||
Mode string `json:"mode"`
|
||||
Recursive bool `json:"recursive,omitempty"`
|
||||
}
|
||||
|
||||
func (ChmodStageOptions) isStageOptions() {}
|
||||
|
||||
// NewChmodStage creates a new org.osbuild.chmod stage
|
||||
func NewChmodStage(options *ChmodStageOptions) *Stage {
|
||||
return &Stage{
|
||||
Type: "org.osbuild.chmod",
|
||||
Options: options,
|
||||
}
|
||||
}
|
||||
32
internal/osbuild2/nginxconf_stage.go
Normal file
32
internal/osbuild2/nginxconf_stage.go
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package osbuild2
|
||||
|
||||
type NginxConfigStageOptions struct {
|
||||
// Config file location
|
||||
Path string `json:"path,omitempty"`
|
||||
|
||||
Config *NginxConfig `json:"config,omitempty"`
|
||||
}
|
||||
|
||||
func (NginxConfigStageOptions) isStageOptions() {}
|
||||
|
||||
type NginxConfig struct {
|
||||
// The address and/or port on which the server will accept requests
|
||||
Listen string `json:"listen,omitempty"`
|
||||
|
||||
// The root directory for requests
|
||||
Root string `json:"root,omitempty"`
|
||||
|
||||
// File that will store the process ID of the main process
|
||||
PID string `json:"pid,omitempty"`
|
||||
|
||||
// Whether nginx should become a daemon
|
||||
Daemon *bool `json:"daemon,omitempty"`
|
||||
}
|
||||
|
||||
// NewNingxConfigStage creates a new org.osbuild.nginxconfig stage
|
||||
func NewNginxConfigStage(options *NginxConfigStageOptions) *Stage {
|
||||
return &Stage{
|
||||
Type: "org.osbuild.nginx.conf",
|
||||
Options: options,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue