0
0
mirror of https://github.com/thegeeklab/wp-git-clone.git synced 2024-11-10 04:00:39 +00:00
wp-git-clone/plugin/plugin.go
2023-12-23 00:59:23 +01:00

57 lines
939 B
Go

// Copyright (c) 2023, Robert Kaussow <mail@thegeeklab.de>
// Use of this source code is governed by an Apache 2.0 license that can be
// found in the LICENSE file.
package plugin
import (
"github.com/thegeeklab/wp-git-clone/git"
wp "github.com/thegeeklab/wp-plugin-go/plugin"
)
// Plugin implements provide the plugin.
type Plugin struct {
*wp.Plugin
Settings *Settings
}
type Pipeline struct {
Event string
Number int
}
type Netrc struct {
Machine string
Login string
Password string
}
// Settings for the plugin.
type Settings struct {
Depth int
Recursive bool
Tags bool
Lfs bool
Partial bool
Filter string
UseSSH bool
SSHKey string
WorkDir string
Pipeline Pipeline
Netrc Netrc
Repo git.Repository
}
func New(options wp.Options, settings *Settings) *Plugin {
p := &Plugin{}
options.Execute = p.run
p.Plugin = wp.New(options)
p.Settings = settings
return p
}