Documentation ¶
Overview ¶
Copyright © 2019 IBM Corporation and others.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 IBM Corporation and others.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 IBM Corporation and others.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 IBM Corporation and others.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 IBM Corporation and others.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 IBM Corporation and others.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 IBM Corporation and others.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 IBM Corporation and others.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 IBM Corporation and others.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 IBM Corporation and others.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 IBM Corporation and others.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 IBM Corporation and others.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func AddLocalFileRepo(repoName string, repoFilePath string, config *RootCommandConfig) (string, error)
- func ApplyTemplating(stackPath string, templateMetadata interface{}) error
- func ArgsToString(args []string) string
- func BuildahBuild(config *RootCommandConfig, args []string, logger appsodylogger) error
- func CheckPrereqs(config *RootCommandConfig) error
- func CheckStackRequirements(log *LoggingConfig, requirementArray map[string]string, buildah bool) error
- func CheckValidSemver(version string) error
- func ConvertLabelToKubeFormat(key string) (string, error)
- func ConvertToValidProjectName(projectDir string) (string, error)
- func CopyDir(log *LoggingConfig, fromDir string, toDir string) error
- func CopyFile(log *LoggingConfig, source string, dest string) error
- func CreateLabelPairs(labels map[string]string) []string
- func CreateTemplateMap(labels map[string]string, stackYaml StackYaml, imageNamespace string, ...) (map[string]interface{}, error)
- func DockerBuild(config *RootCommandConfig, args []string, logger appsodylogger) error
- func DockerRunAndListen(config *RootCommandConfig, args []string, logger appsodylogger, ...) (*exec.Cmd, error)
- func DockerRunBashCmd(options []string, image string, bashCmd string, config *RootCommandConfig) (string, error)
- func Execute(version string, controllerVersion string)
- func ExecuteE(version string, controllerVersion string, projectDir string, ...) error
- func Exists(path string) (bool, error)
- func ExtractDockerEnvFile(envFileName string) (map[string]string, error)
- func ExtractDockerEnvVars(dockerOptions string) (map[string]string, error)
- func GenDeploymentYaml(log *LoggingConfig, appName string, imageName string, ...) (fileName string, err error)
- func GenRouteYaml(log *LoggingConfig, appName string, pdir string, port int, dryrun bool) (fileName string, err error)
- func GenServiceYaml(log *LoggingConfig, appName string, ports []string, pdir string, dryrun bool) (fileName string, err error)
- func GenerateID(log *LoggingConfig) string
- func GenerateVolumeName(config *RootCommandConfig) string
- func GetDepVolumeArgs(config *RootCommandConfig) ([]string, error)
- func GetDeprecated(config *RootCommandConfig) error
- func GetEnvVar(searchEnvVar string, config *RootCommandConfig) (string, error)
- func GetIDFromConfig(config *RootCommandConfig) (string, error)
- func GetLabelsForStackImage(stackID string, buildImage string, stackYaml StackYaml, ...) (map[string]string, error)
- func GetUpdateString(osName string, version string, latest string) string
- func ImagePush(log *LoggingConfig, imageToPush string, buildah bool, dryrun bool) error
- func InArray(haystack []string, needle string) bool
- func InitConfig(config *RootCommandConfig) error
- func IsEmptyDir(name string) bool
- func IsValidApplicationName(name string) (bool, error)
- func IsValidKubernetesLabelValue(value string) (bool, error)
- func IsValidProjectName(name string) (bool, error)
- func KubeApply(log *LoggingConfig, fileToApply string, namespace string, dryrun bool) error
- func KubeDelete(log *LoggingConfig, fileToApply string, namespace string, dryrun bool) error
- func KubeGet(log *LoggingConfig, args []string, namespace string, dryrun bool) (string, error)
- func KubeGetClusterURL(log *LoggingConfig, service string, namespace string, dryrun bool) (url string, err error)
- func KubeGetDeploymentURL(log *LoggingConfig, serviceName string, service map[string]interface{}, ...) (url string, err error)
- func KubeGetKnativeURL(log *LoggingConfig, service string, namespace string, dryrun bool) (url string, err error)
- func KubeGetNodePortURL(log *LoggingConfig, service string, namespace string, dryrun bool) (url string, err error)
- func KubeGetNodePortURLIBMCloud(log *LoggingConfig, service string, namespace string, dryrun bool) (url string, err error)
- func KubeGetRouteURL(log *LoggingConfig, service string, namespace string, dryrun bool) (url string, err error)
- func MoveDir(log *LoggingConfig, fromDir string, toDir string) error
- func NormalizeImageName(imageName string) (string, error)
- func OverrideStackRegistry(override string, imageName string) (string, error)
- func RemoveIfExists(path string) error
- func RunAppsodyCmdExec(args []string, workingDir string, rootConfig *RootCommandConfig) (string, error)
- func RunBuildahCommandAndListen(config *RootCommandConfig, args []string, logger appsodylogger, ...) (*exec.Cmd, error)
- func RunCommandAndListen(config *RootCommandConfig, commandValue string, args []string, ...) (*exec.Cmd, error)
- func RunDockerCmdExec(args []string, log *LoggingConfig) (string, error)
- func RunDockerCommandAndListen(config *RootCommandConfig, args []string, logger appsodylogger, ...) (*exec.Cmd, error)
- func RunDockerCommandAndWait(config *RootCommandConfig, args []string, logger appsodylogger) error
- func RunDockerInspect(log *LoggingConfig, imageName string) (string, error)
- func RunDockerVolumeList(log *LoggingConfig, volName string) (string, error)
- func RunGit(log *LoggingConfig, workDir string, kargs []string, dryrun bool) (string, error)
- func RunGitBranchContains(log *LoggingConfig, commitSHA string, workDir string, lineSeparator string, ...) ([]string, error)
- func RunGitConfigLocalRemoteOriginURL(log *LoggingConfig, workDir string, upstream string, dryrun bool) (string, error)
- func RunGitRemote(log *LoggingConfig, workDir string, lineSeparator string, dryrun bool) ([]string, error)
- func RunGitVersion(log *LoggingConfig, workDir string, dryrun bool) (string, error)
- func RunKube(log *LoggingConfig, kargs []string, dryrun bool) (string, error)
- func RunKubeCommandAndListen(config *RootCommandConfig, args []string, logger appsodylogger, ...) (*exec.Cmd, error)
- func RunKubeDelete(log *LoggingConfig, args []string, dryrun bool) (string, error)
- func RunKubeExec(log *LoggingConfig, args []string, dryrun bool) (string, error)
- func RunKubeGet(log *LoggingConfig, args []string, dryrun bool) (string, error)
- func SaveIDToConfig(ID string, config *RootCommandConfig) error
- func SeparateOutput(cmd *exec.Cmd) (string, error)
- func SplitBuildOptions(options string) []string
- func StringAfter(value string, searchValue string) string
- func StringBefore(value string, searchValue string) string
- func StringBetween(value string, pre string, post string) string
- func Targz(log *LoggingConfig, source, target, filename string) error
- func TestBuild(log *LoggingConfig, stack string, template string, projectDir string, ...) error
- func TestInit(log *LoggingConfig, stack string, template string, projectDir string, ...) error
- func TestRun(log *LoggingConfig, stack string, template string, projectDir string, ...) error
- func TestTest(log *LoggingConfig, stack string, template string, projectDir string, ...) error
- func UserHomeDir(log *LoggingConfig) string
- func ValidateHostNameAndPort(hostNameAndPort string) (bool, error)
- type CommitInfo
- type DeploymentManifest
- type GitInfo
- type IndexJSONStack
- type IndexOutputFormat
- type IndexYaml
- type IndexYamlStack
- type IndexYamlStackTemplate
- type Link
- type LoggingConfig
- type Maintainer
- type NotAnAppsodyProject
- type OwnerReference
- type ProjectConfig
- type ProjectEntry
- type ProjectFile
- func (p *ProjectFile) Add(projectEntry ...*ProjectEntry)
- func (p *ProjectFile) AddDepsVolumesToProjectEntry(depsEnvVars []string, volumeMaps []string, rootConfig *RootCommandConfig) ([]string, error)
- func (p *ProjectFile) AddNewProject(ID string, config *RootCommandConfig) error
- func (p *ProjectFile) EnsureProjectIDAndEntryExists(rootConfig *RootCommandConfig) (*ProjectEntry, string, error)
- func (p *ProjectFile) GetProject(id string) *ProjectEntry
- func (p *ProjectFile) GetProjects(fileLocation string) (*ProjectFile, error)
- func (p *ProjectFile) HasID(id string) bool
- func (p *ProjectFile) Remove(id string)
- func (p *ProjectFile) WriteFile(path string) error
- type ProjectVersions
- type RepoIndices
- type RepositoryEntry
- type RepositoryFile
- func (r *RepositoryFile) Add(re ...*RepositoryEntry)
- func (r *RepositoryFile) GetDefaultRepoName(rootConfig *RootCommandConfig) (string, error)
- func (r *RepositoryFile) GetIndices(log *LoggingConfig) (RepoIndices, error)
- func (r *RepositoryFile) GetRepo(name string) *RepositoryEntry
- func (r *RepositoryFile) Has(name string) bool
- func (r *RepositoryFile) HasURL(url string) bool
- func (r *RepositoryFile) Remove(name string, log *LoggingConfig)
- func (r *RepositoryFile) SetDefaultRepoName(name string, defaultRepoName string, rootConfig *RootCommandConfig) (string, error)
- func (r *RepositoryFile) WriteFile(path string) error
- type RepositoryOutputFormat
- type RootCommandConfig
- type Stack
- type StackContainer
- type StackRequirement
- type StackYaml
- type Volume
Constants ¶
const APIVersionV1 = "v1"
const ConfigFile = ".appsody-config.yaml"
const LatestVersionURL = "https://github.com/appsody/appsody/releases/latest"
Variables ¶
var CONTROLLERVERSION string
var VERSION string
Functions ¶
func AddLocalFileRepo ¶
func AddLocalFileRepo(repoName string, repoFilePath string, config *RootCommandConfig) (string, error)
func ApplyTemplating ¶
ApplyTemplating - walks through the copied folder directory and applies a template using the previously created templateMetada to all files in the target directory
func ArgsToString ¶
Converts an array of command arguments to a string of arguments properly escaped and quoted for copying and running in sh, bash, or zsh
func BuildahBuild ¶
func BuildahBuild(config *RootCommandConfig, args []string, logger appsodylogger) error
func CheckPrereqs ¶
func CheckPrereqs(config *RootCommandConfig) error
CheckPrereqs checks the prerequisites to run the CLI
func CheckStackRequirements ¶
func CheckStackRequirements(log *LoggingConfig, requirementArray map[string]string, buildah bool) error
Compares the minimum requirements of a stack against the user to determine whether they can use the stack or not.
func CheckValidSemver ¶
func ConvertToValidProjectName ¶
ConvertToValidProjectName takes an existing string or directory path and returns a name that conforms to isValidContainerName rules
func CopyDir ¶
func CopyDir(log *LoggingConfig, fromDir string, toDir string) error
CopyDir Copies folder from source destination to target destination
func CopyFile ¶
func CopyFile(log *LoggingConfig, source string, dest string) error
CopyFile uses OS commands to copy a file from a source to a destination
func CreateLabelPairs ¶
func CreateTemplateMap ¶
func CreateTemplateMap(labels map[string]string, stackYaml StackYaml, imageNamespace string, imageRegistry string) (map[string]interface{}, error)
CreateTemplateMap - uses the git labels, stack.yaml, stackID and imageNamespace to create a map with all the necessary data needed for the template
func DockerBuild ¶
func DockerBuild(config *RootCommandConfig, args []string, logger appsodylogger) error
func DockerRunAndListen ¶
func DockerRunAndListen(config *RootCommandConfig, args []string, logger appsodylogger, interactive bool) (*exec.Cmd, error)
DockerRunAndListen runs a Docker command with arguments in args This function does NOT override the image registry (uses args as is)
func DockerRunBashCmd ¶
func DockerRunBashCmd(options []string, image string, bashCmd string, config *RootCommandConfig) (string, error)
DockerRunBashCmd issues a shell command in a docker image, overriding its entrypoint Assume this is only used for Stack images
func ExtractDockerEnvFile ¶
ExtractDockerEnvFile returns a map with the env vars specified in docker env file
func ExtractDockerEnvVars ¶
ExtractDockerEnvVars returns a map with the env vars specified in docker options
func GenDeploymentYaml ¶
func GenDeploymentYaml(log *LoggingConfig, appName string, imageName string, controllerImageName string, ports []string, pdir string, dockerMounts []string, dockerEnvVars map[string]string, depsMount string, mode string, dryrun bool) (fileName string, err error)
GenDeploymentYaml generates a simple yaml for a plaing K8S deployment
func GenRouteYaml ¶
func GenRouteYaml(log *LoggingConfig, appName string, pdir string, port int, dryrun bool) (fileName string, err error)
GenRouteYaml returns the file name of a generated K8S Service yaml
func GenServiceYaml ¶
func GenServiceYaml(log *LoggingConfig, appName string, ports []string, pdir string, dryrun bool) (fileName string, err error)
GenServiceYaml returns the file name of a generated K8S Service yaml
func GenerateID ¶
func GenerateID(log *LoggingConfig) string
create unique project id for .appsody-config.yaml
func GenerateVolumeName ¶
func GenerateVolumeName(config *RootCommandConfig) string
create unique name for APPSODY_DEPS volumes
func GetDepVolumeArgs ¶
func GetDepVolumeArgs(config *RootCommandConfig) ([]string, error)
get APPSODY_DEPS environment variable and split it into and array
func GetDeprecated ¶
func GetDeprecated(config *RootCommandConfig) error
func GetEnvVar ¶
func GetEnvVar(searchEnvVar string, config *RootCommandConfig) (string, error)
GetEnvVar obtains a Stack environment variable from the Stack image
func GetIDFromConfig ¶
func GetIDFromConfig(config *RootCommandConfig) (string, error)
get project id from .appsody-config.yaml and create project entry if id does not exist
func GetLabelsForStackImage ¶
func GetLabelsForStackImage(stackID string, buildImage string, stackYaml StackYaml, config *RootCommandConfig) (map[string]string, error)
GetLabelsForStackImage - Gets labels associated with the stack image
func GetUpdateString ¶
GetUpdateString Returns a format string to advise the user how to upgrade
func ImagePush ¶
func ImagePush(log *LoggingConfig, imageToPush string, buildah bool, dryrun bool) error
ImagePush pushes a docker image to a docker registry (assumes that the user has done docker login)
func InitConfig ¶
func InitConfig(config *RootCommandConfig) error
func IsEmptyDir ¶
func IsValidApplicationName ¶
func IsValidProjectName ¶
func KubeApply ¶
func KubeApply(log *LoggingConfig, fileToApply string, namespace string, dryrun bool) error
KubeApply issues kubectl apply -f <filename>
func KubeDelete ¶
func KubeDelete(log *LoggingConfig, fileToApply string, namespace string, dryrun bool) error
KubeDelete issues kubectl delete -f <filename>
func KubeGetClusterURL ¶
func KubeGetClusterURL(log *LoggingConfig, service string, namespace string, dryrun bool) (url string, err error)
KubeGetClusterURL kubectl get svc <service> -o jsonpath=http://{.spec.clusterIP}:{.spec.ports[0].port} and prints the return URL
func KubeGetDeploymentURL ¶
func KubeGetDeploymentURL(log *LoggingConfig, serviceName string, service map[string]interface{}, namespace string, dryrun bool) (url string, err error)
KubeGetDeploymentURL searches for an exposed hostname and port for the deployed service
func KubeGetKnativeURL ¶
func KubeGetKnativeURL(log *LoggingConfig, service string, namespace string, dryrun bool) (url string, err error)
KubeGetKnativeURL issues kubectl get rt <service> -o jsonpath="{.status.url}" and prints the return URL
func KubeGetNodePortURL ¶
func KubeGetNodePortURL(log *LoggingConfig, service string, namespace string, dryrun bool) (url string, err error)
KubeGetNodePortURL kubectl get svc <service> -o jsonpath=http://{.status.loadBalancer.ingress[0].hostname}:{.spec.ports[0].nodePort} and prints the return URL
func KubeGetNodePortURLIBMCloud ¶
func KubeGetNodePortURLIBMCloud(log *LoggingConfig, service string, namespace string, dryrun bool) (url string, err error)
KubeGetNodePortURLIBMCloud issues several kubectl commands and prints the concatenated URL
func KubeGetRouteURL ¶
func KubeGetRouteURL(log *LoggingConfig, service string, namespace string, dryrun bool) (url string, err error)
KubeGetRouteURL issues kubectl get svc <service> -o jsonpath=http://{.status.loadBalancer.ingress[0].hostname}:{.spec.ports[0].nodePort} and prints the return URL
func MoveDir ¶
func MoveDir(log *LoggingConfig, fromDir string, toDir string) error
MoveDir moves a directory to another directory, even if they are on different partitions
func NormalizeImageName ¶
NormalizeImageName is a temporary fix for buildah workaround #676
func OverrideStackRegistry ¶
OverrideStackRegistry allows you to change the image registry URL
func RemoveIfExists ¶
RemoveIfExists - Checks if inode exists and removes it if it does
func RunAppsodyCmdExec ¶
func RunAppsodyCmdExec(args []string, workingDir string, rootConfig *RootCommandConfig) (string, error)
RunAppsodyCmdExec runs the appsody CLI with the given args in a new process The stdout and stderr are captured, printed, and returned args will be passed to the appsody command workingDir will be the directory the command runs in
func RunCommandAndListen ¶
func RunDockerCmdExec ¶
func RunDockerCmdExec(args []string, log *LoggingConfig) (string, error)
RunDockerCmdExec runs the docker command with the given args in a new process The stdout and stderr are captured, printed, and returned args will be passed to the docker command workingDir will be the directory the command runs in
func RunDockerCommandAndWait ¶
func RunDockerCommandAndWait(config *RootCommandConfig, args []string, logger appsodylogger) error
func RunDockerInspect ¶
func RunDockerInspect(log *LoggingConfig, imageName string) (string, error)
RunDockerInspect -TODO - this function should be removed. No one uses it, except the test. We are using inspectImage
func RunDockerVolumeList ¶
func RunDockerVolumeList(log *LoggingConfig, volName string) (string, error)
RunDockerVolumeList lists all the volumes containing a certain string
func RunGitBranchContains ¶
func RunGitConfigLocalRemoteOriginURL ¶
func RunGitConfigLocalRemoteOriginURL(log *LoggingConfig, workDir string, upstream string, dryrun bool) (string, error)
RunGitConfigLocalRemoteOriginURL
func RunGitRemote ¶
func RunGitVersion ¶
func RunGitVersion(log *LoggingConfig, workDir string, dryrun bool) (string, error)
RunGitVersion
func RunKube ¶
func RunKube(log *LoggingConfig, kargs []string, dryrun bool) (string, error)
RunKube runs a generic kubectl command
func RunKubeCommandAndListen ¶
func RunKubeDelete ¶
func RunKubeDelete(log *LoggingConfig, args []string, dryrun bool) (string, error)
RunKubeDelete issues kubectl delete <args>
func RunKubeExec ¶
func RunKubeExec(log *LoggingConfig, args []string, dryrun bool) (string, error)
RunKubeExec issues kubectl exec <arg>
func RunKubeGet ¶
func RunKubeGet(log *LoggingConfig, args []string, dryrun bool) (string, error)
RunKubeGet issues kubectl get <arg>
func SaveIDToConfig ¶
func SaveIDToConfig(ID string, config *RootCommandConfig) error
save project id to .appsody-config.yaml
func SplitBuildOptions ¶
func StringAfter ¶
func StringBefore ¶
func Targz ¶
func Targz(log *LoggingConfig, source, target, filename string) error
tar and zip a directory into .tar.gz
func TestBuild ¶
func TestBuild(log *LoggingConfig, stack string, template string, projectDir string, rootConfig *RootCommandConfig) error
Simple test for appsody build command. A future enhancement would be to verify the image that gets built.
func TestInit ¶
func TestInit(log *LoggingConfig, stack string, template string, projectDir string, rootConfig *RootCommandConfig) error
Simple test for appsody init command
func TestRun ¶
func TestRun(log *LoggingConfig, stack string, template string, projectDir string, rootConfig *RootCommandConfig) error
Simple test for appsody run command. A future enhancement would be to verify the image that gets built.
func TestTest ¶
func TestTest(log *LoggingConfig, stack string, template string, projectDir string, rootConfig *RootCommandConfig) error
Simple test for appsody build command. A future enhancement would be to verify the image that gets built.
func UserHomeDir ¶
func UserHomeDir(log *LoggingConfig) string
UserHomeDir returns the current user's home directory or '.'
func ValidateHostNameAndPort ¶
ValidateHostNameAndPort validates that hostNameAndPort conform to the DNS naming conventions
Types ¶
type CommitInfo ¶
type CommitInfo struct { SHA string Date string URL string Message string Pushed bool // contains filtered or unexported fields }
func RunGitGetLastCommit ¶
func RunGitGetLastCommit(config *RootCommandConfig) (CommitInfo, error)
RunGitLog issues git log
type DeploymentManifest ¶
type DeploymentManifest struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec map[string]interface{} `json:"spec,omitempty"` Status interface{} `json:"status,omitempty"` }
type GitInfo ¶
type GitInfo struct { Branch string Upstream string RemoteURL string ChangesMade bool Commit CommitInfo }
func GetGitInfo ¶
func GetGitInfo(config *RootCommandConfig) (GitInfo, error)
RunGitFindBranch issues git status
type IndexJSONStack ¶
type IndexJSONStack struct { DisplayName string `json:"displayName"` Description string `json:"description"` Language string `json:"language"` ProjectType string `json:"projectType"` ProjectStyle string `json:"projectStyle"` Location string `json:"location"` Links Link `json:"links"` Deprecated string `json:"deprecated,omitempty"` }
struct to convert yaml to json files
type IndexOutputFormat ¶
type IndexOutputFormat struct { APIVersion string `yaml:"apiVersion" json:"apiVersion"` Generated time.Time `yaml:"generated" json:"generated"` Repositories []RepositoryOutputFormat `yaml:"repositories" json:"repositories"` }
Type for outputting stacks of a repository in JSON and YAML
type IndexYaml ¶
type IndexYaml struct { APIVersion string `yaml:"apiVersion"` Generated time.Time `yaml:"generated,omitempty"` Projects map[string]ProjectVersions `yaml:"projects,omitempty"` Stacks []IndexYamlStack }
type IndexYamlStack ¶
type IndexYamlStack struct { ID string `yaml:"id"` Name string `yaml:"name"` Version string `yaml:"version"` Description string `yaml:"description"` License string `yaml:"license"` Language string `yaml:"language"` Maintainers []Maintainer DefaultTemplate string `yaml:"default-template"` SourceURL string `yaml:"src"` Templates []IndexYamlStackTemplate Requirements StackRequirement `yaml:"requirements,omitempty"` Image string `yaml:"image"` Deprecated string `yaml:"deprecated,omitempty"` }
type IndexYamlStackTemplate ¶
type LoggingConfig ¶
type LoggingConfig struct { // define the logging levels Info appsodylogger Warning appsodylogger Error appsodylogger Debug appsodylogger Container appsodylogger InitScript appsodylogger DockerLog appsodylogger BuildahLog appsodylogger }
func (*LoggingConfig) InitLogging ¶
func (config *LoggingConfig) InitLogging(outWriter, errWriter io.Writer)
InitLogging initializes the logging configuration for a given RootCommandConfig. The initialization of klog is global and will only be performed once.
type Maintainer ¶
type NotAnAppsodyProject ¶
type NotAnAppsodyProject string
func (NotAnAppsodyProject) Error ¶
func (e NotAnAppsodyProject) Error() string
type OwnerReference ¶
type ProjectConfig ¶
type ProjectEntry ¶
type ProjectFile ¶
type ProjectFile struct {
Projects []*ProjectEntry `yaml:"projects"`
}
func NewProjectFile ¶
func NewProjectFile() *ProjectFile
func (*ProjectFile) Add ¶
func (p *ProjectFile) Add(projectEntry ...*ProjectEntry)
add a new project entry to the project.yaml file
func (*ProjectFile) AddDepsVolumesToProjectEntry ¶
func (p *ProjectFile) AddDepsVolumesToProjectEntry(depsEnvVars []string, volumeMaps []string, rootConfig *RootCommandConfig) ([]string, error)
create docker volume names for every path in APPSODY_DEPS and put it in project.yaml
func (*ProjectFile) AddNewProject ¶
func (p *ProjectFile) AddNewProject(ID string, config *RootCommandConfig) error
add new project entry to ~/.appsody/project.yaml
func (*ProjectFile) EnsureProjectIDAndEntryExists ¶
func (p *ProjectFile) EnsureProjectIDAndEntryExists(rootConfig *RootCommandConfig) (*ProjectEntry, string, error)
func (*ProjectFile) GetProject ¶
func (p *ProjectFile) GetProject(id string) *ProjectEntry
get project from project.yaml with given id
func (*ProjectFile) GetProjects ¶
func (p *ProjectFile) GetProjects(fileLocation string) (*ProjectFile, error)
get all project entries from project.yaml
func (*ProjectFile) HasID ¶
func (p *ProjectFile) HasID(id string) bool
check if project.yaml file had a project with given id
func (*ProjectFile) Remove ¶
func (p *ProjectFile) Remove(id string)
func (*ProjectFile) WriteFile ¶
func (p *ProjectFile) WriteFile(path string) error
write to the project.yaml file
type ProjectVersions ¶
type ProjectVersions []*IndexYamlStack
type RepoIndices ¶
RepoIndices maps repos to their RepoIndex (i.e. the projects in a repo)
type RepositoryEntry ¶
type RepositoryFile ¶
type RepositoryFile struct { APIVersion string `yaml:"apiVersion" json:"apiVersion"` Generated time.Time `yaml:"generated" json:"generated"` Repositories []*RepositoryEntry `yaml:"repositories" json:"repositories"` }
func NewRepoFile ¶
func NewRepoFile() *RepositoryFile
func (*RepositoryFile) Add ¶
func (r *RepositoryFile) Add(re ...*RepositoryEntry)
func (*RepositoryFile) GetDefaultRepoName ¶
func (r *RepositoryFile) GetDefaultRepoName(rootConfig *RootCommandConfig) (string, error)
func (*RepositoryFile) GetIndices ¶
func (r *RepositoryFile) GetIndices(log *LoggingConfig) (RepoIndices, error)
func (*RepositoryFile) GetRepo ¶
func (r *RepositoryFile) GetRepo(name string) *RepositoryEntry
func (*RepositoryFile) Has ¶
func (r *RepositoryFile) Has(name string) bool
func (*RepositoryFile) HasURL ¶
func (r *RepositoryFile) HasURL(url string) bool
func (*RepositoryFile) Remove ¶
func (r *RepositoryFile) Remove(name string, log *LoggingConfig)
func (*RepositoryFile) SetDefaultRepoName ¶
func (r *RepositoryFile) SetDefaultRepoName(name string, defaultRepoName string, rootConfig *RootCommandConfig) (string, error)
func (*RepositoryFile) WriteFile ¶
func (r *RepositoryFile) WriteFile(path string) error
type RepositoryOutputFormat ¶
type RootCommandConfig ¶
type RootCommandConfig struct { *LoggingConfig CfgFile string Dryrun bool Verbose bool CliConfig *viper.Viper Buildah bool ProjectConfig *ProjectConfig ProjectDir string UnsupportedRepos []string StackRegistry string StackRegistryInit string CachedEnvVars map[string]string // contains filtered or unexported fields }
type Stack ¶
type Stack struct { ID string `yaml:"id,omitempty" json:"id,omitempty"` Version string `yaml:"version" json:"version"` Description string `yaml:"description" json:"description"` Templates []IndexYamlStackTemplate `yaml:"templates,omitempty" json:"templates,omitempty"` Deprecated string `yaml:"deprecated,omitempty" json:"deprecated,omitempty"` // contains filtered or unexported fields }
type StackContainer ¶
type StackContainer struct { ID string // contains filtered or unexported fields }
StackContainer is our internal representation of the attributes of stack based container
type StackRequirement ¶
type StackYaml ¶
type StackYaml struct { Name string `yaml:"name"` Version string `yaml:"version"` Description string `yaml:"description"` License string `yaml:"license"` Language string `yaml:"language"` Maintainers []Maintainer DefaultTemplate string `yaml:"default-template"` TemplatingData map[string]string `yaml:"templating-data"` Requirements StackRequirement `yaml:"requirements,omitempty"` Deprecated string `yaml:"deprecated,omitempty"` }
structs for parsing the yaml files
Source Files ¶
- build.go
- build_delete.go
- build_setup.go
- completion.go
- debug.go
- deploy.go
- deploy_delete.go
- dev_common.go
- docker_commands.go
- docs.go
- extract.go
- git_utils.go
- init.go
- list.go
- operator.go
- operator_install.go
- operator_uninstall.go
- operator_utils.go
- ps.go
- repo.go
- repo_add.go
- repo_list.go
- repo_remove.go
- repo_set_default.go
- root.go
- run.go
- stack.go
- stack_addtorepo.go
- stack_create.go
- stack_lint.go
- stack_lint_dockerfile_stack.go
- stack_package.go
- stack_removefromrepo.go
- stack_validate.go
- stack_validate_utils.go
- stack_yaml_lint.go
- stop.go
- test.go
- utils.go
- version.go