pkg

package
v0.0.0-...-7f84fde Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

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 AbsPath

func AbsPath(dest string) string

func GenerateGitHubActionsBuildFile

func GenerateGitHubActionsBuildFile(imageName string) string

func SetupGithubActions

func SetupGithubActions(repoRoot, imageName string) error

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 SyncTemplates(dest string) error

func SynthesizeDeployment

func SynthesizeDeployment(deployCtx map[string]any, deployId string, outDir string) error

func SynthesizePipelineConfigurationFile

func SynthesizePipelineConfigurationFile(pipeline Pipeline, outDir string) (string, error)

SynthesizePipelineConfigurationFile generates a Dockerfile from a pipeline configuration

func SynthesizeProject

func SynthesizeProject(ctx context.Context, tid string, dm *DerivedMetadata, noRemote bool, deployId *string) error

func SynthesizeProjectFromDir

func SynthesizeProjectFromDir(ctx map[string]any, srcTemplateDir string, cfg *Configuration, outDir string) (err error)

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

func (c *Commands) UnmarshalYAML(unmarshal func(interface{}) error) error

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.

func (*GithubAPI) GetAuthUser

func (api *GithubAPI) GetAuthUser(ctx context.Context) (*github.User, error)

type Pipeline

type Pipeline struct {
	Setup   []string
	Build   []string
	Install []string
	Run     string
}

func (*Pipeline) Dockerfile

func (pipeline *Pipeline) Dockerfile() string

type SSHKeys

type SSHKeys struct {
	// contains filtered or unexported fields
}

func NewSSHKeys

func NewSSHKeys() *SSHKeys

func (*SSHKeys) Get

func (s *SSHKeys) Get() string

func (*SSHKeys) List

func (s *SSHKeys) List() []string

func (*SSHKeys) SetSelected

func (s *SSHKeys) SetSelected(i int)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL