Documentation
¶
Index ¶
- Constants
- func AbsPath(dest string) string
- func GenerateGitHubActionsBuildFile(imageName string) string
- func SetupGithubActions(repoRoot, imageName string) error
- func SetupGithubRemote(ctx context.Context, namespace string, repoName string, ...) error
- func SyncTemplates(dest string) error
- func SynthesizeDeployment(deployCtx map[string]any, deployId string, outDir string) error
- func SynthesizePipelineConfigurationFile(pipeline Pipeline, outDir string) (string, error)
- func SynthesizeProject(ctx context.Context, tid string, dm *DerivedMetadata, noRemote bool, ...) error
- func SynthesizeProjectFromDir(ctx map[string]any, srcTemplateDir string, cfg *Configuration, outDir string) (err error)
- func VersionControl(dir, repoName string) (*git.Repository, error)
- type Commands
- type Configuration
- type DerivedMetadata
- type GithubAPI
- type Pipeline
- type SSHKeys
- type TemplateProvider
Constants ¶
View Source
const ( GEN_CFG_FILENAME = "package.yml" TEMPLATE_DIRNAME = "templates" DEFAULT_TEMPLATES_DIR = "~/.jumpstart/" + TEMPLATE_DIRNAME TEMPLATE_SOURCE = "https://github.com/nurdsoft/jumpstart-templates" )
View Source
const (
DEFAULT_CODEPROVIDER = "github.com"
)
View Source
const GITHUB_ACTIONS_DIR = ".github/workflows"
Variables ¶
This section is empty.
Functions ¶
func SetupGithubActions ¶
func SetupGithubRemote ¶
func SetupGithubRemote(ctx context.Context, namespace string, repoName string, localRepo *git.Repository, push bool) error
namespace should be empty if it is not an org
func SyncTemplates ¶
func SynthesizeDeployment ¶
func SynthesizePipelineConfigurationFile ¶
SynthesizePipelineConfigurationFile generates a Dockerfile from a pipeline configuration
func SynthesizeProject ¶
func VersionControl ¶
func VersionControl(dir, repoName string) (*git.Repository, error)
Types ¶
type Commands ¶
type Commands struct {
UnixLike []string `yaml:"unix"`
Windows []string `yaml:"windows"`
All []string
}
func (*Commands) UnmarshalYAML ¶
type Configuration ¶
type Configuration struct {
// Name of the template
Name string `yaml:"name"`
// Language binary
Binary string `yaml:"binary"`
// Commands run to setup the local repository
Commands Commands `yaml:"commands"`
// Build pipeline
Pipeline Pipeline `yaml:"pipeline"`
}
func GetTemplateConfiguration ¶
func GetTemplateConfiguration(ctx pongo2.Context, srcTemplateDir string) (*Configuration, error)
type DerivedMetadata ¶
type DerivedMetadata struct {
// Project name
Name string
// Github namespace / organization
Namespace string
// Authenticated user
User string
// Code provider
CodeProvider string
// Output directory
OutDir string
}
func NewDerivedMetadata ¶
func NewDerivedMetadata(ctx context.Context, input string) (*DerivedMetadata, error)
func (*DerivedMetadata) IsGithubOrg ¶
func (dm *DerivedMetadata) IsGithubOrg() bool
type GithubAPI ¶
type GithubAPI struct {
// contains filtered or unexported fields
}
func NewGithubAPI ¶
func NewGithubAPI() *GithubAPI
func (*GithubAPI) CreateRepo ¶
func (api *GithubAPI) CreateRepo(ctx context.Context, orgName, repoName string) (*github.Repository, error)
orgName is the name of the organization to create the repo in. If it is an empty string, the repo will be created in the user's account.
type Pipeline ¶
func (*Pipeline) Dockerfile ¶
type SSHKeys ¶
type SSHKeys struct {
// contains filtered or unexported fields
}
func NewSSHKeys ¶
func NewSSHKeys() *SSHKeys
func (*SSHKeys) SetSelected ¶
type TemplateProvider ¶
type TemplateProvider struct {
// contains filtered or unexported fields
}
func NewTemplateProvider ¶
func NewTemplateProvider(baseDir string) (*TemplateProvider, error)
func (*TemplateProvider) GetTemplate ¶
func (tp *TemplateProvider) GetTemplate(name string) string
func (*TemplateProvider) ListTemplates ¶
func (tp *TemplateProvider) ListTemplates() []string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.