Documentation ¶
Index ¶
- Constants
- type BuilderParams
- type CreateDeploymentParams
- type CreateServiceNodePortParams
- type GetDeploymentParams
- type ImageBuilderParams
- type K8SClient
- type Option
- func WithAppLabel(appName string) Option
- func WithBaseBranchLabel(baseBranch string) Option
- func WithCreatedByLabel(name string) Option
- func WithEnvirionmentLabel(envirionment string) Option
- func WithImagePullPolicy(image, policy string) Option
- func WithLabelSelector(labelSelector map[string]string) Option
- func WithPrIDLabel(prID string) Option
- func WithReplica(replica int32) Option
- func WithRepositoryLabel(repository string) Option
- type UpdateDeploymentParams
Constants ¶
View Source
const ( // Image Builder Environment variables EnvGitRepo = "GIT_REPO" EnvGitBranch = "GIT_BRANCH" EnvImageName = "IMAGE_NAME" EnvImageTag = "IMAGE_TAG" EnvDockerBaseDir = "DOCKER_BASE_DIR" EnvDockerFilePath = "DOCKER_FILE_PATH" EnvDockerRegistry = "DOCKER_REGISTRY" EnvDockerUser = "DOCKER_REGISTRY_USER" EnvDockerPassword = "DOCKER_REGISTRY_PASSWORD" )
View Source
const ( // AppLabel は ns やリソースに付与するラベルのキー。 AppLabel = "app" // CreatedByLabel は ns やリソースに付与するラベルのキー。 // このラベルが付与されたリソースは gantry によって作成されたものとみなす CreatedByLabel = "created" // RepositoryLabel はリソースに付与するラベルのキー。 // このラベルが付与されたリソースはどのリポジトリに関連するかを示す RepositoryLabel = "repository" // PrIDLabel はリソースに付与するラベルのキー。 // このラベルが付与されたリソースはどの PR に関連するかを示す PullRequestID = "pr-id" // BaseBranchLabel はリソースに付与するラベルのキー。 // このラベルが付与されたリソースはどのブランチに関連するかを示す BaseBranchLabel = "base-branch" // EnvirionmentLabel はリソースに付与するラベルのキー。 // このラベルが付与されたリソースはどの環境に関連するかを示す // 基本Botから生成されるデプロイにはpreviewが付与される // ex: staging , production , preview EnvirionmentLabel = "envirionment" )
gantryで扱うラベルの定義
View Source
const ( // AppIdentifier は gantry が扱うリソースの識別子 AppIdentifier = "gantry" // EnvProduction は本番環境を示す EnvProduction = "production" // EnvStaging はステージング環境を示す EnvStaging = "staging" // EnvPreview はプレビュー環境を示す EnvPreview = "preview" )
View Source
const (
// DefaultBackoffLimit はジョブのバックオフリミットのデフォルト値 .
DefaultBackoffLimit = 3
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuilderParams ¶
type BuilderParams struct { Namespace string Branch string BuilderParam ImageBuilderParams }
type CreateDeploymentParams ¶
type GetDeploymentParams ¶
type ImageBuilderParams ¶
type K8SClient ¶
type K8SClient interface { // namespace CreateNamespace(ctx context.Context, name string, opts ...Option) (*corev1.Namespace, error) ListNamespaces(ctx context.Context, opts ...Option) (*corev1.NamespaceList, error) DeleteNamespace(ctx context.Context, name string) error // deployment CreateDeployment(ctx context.Context, in CreateDeploymentParams, opts ...Option) (*appsv1.Deployment, error) GetDeployment(ctx context.Context, param GetDeploymentParams) (*appsv1.Deployment, error) ListDeployments(ctx context.Context, namespace string, opts ...Option) (*appsv1.DeploymentList, error) UpdateDeployment(ctx context.Context, dep *appsv1.Deployment, in UpdateDeploymentParams, opts ...Option) (*appsv1.Deployment, error) DeleteDeployment(ctx context.Context, namespace string, opts ...Option) error // service CreateLoadBalancerService(ctx context.Context, param CreateServiceNodePortParams, opts ...Option) (*corev1.Service, error) DeleteService(ctx context.Context, namespace string, opts ...Option) error // replica set GetReplicaSet(ctx context.Context, namespace string, prefix string) (*appsv1.ReplicaSet, error) // pod GetPods(ctx context.Context, namespace, prefix string) ([]*corev1.Pod, error) CreatePod(ctx context.Context, pod *corev1.Pod, opts metav1.CreateOptions) (*corev1.Pod, error) UpdatePod(ctx context.Context, pod *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error) DeletePod(ctx context.Context, namespace, name string, opts metav1.DeleteOptions) error GetPodUsage(ctx context.Context, namespace, podName string) (*protoV1.Pod, error) // log GetLogs(namespace string, podName string, option corev1.PodLogOptions) *restclient.Request // builder Builder(ctx context.Context, param BuilderParams, opts ...Option) (string, error) // config map CreateConfigMap(ctx context.Context, configMap corev1.ConfigMap, opts metav1.CreateOptions) error UpdateConfigMap(ctx context.Context, configMap corev1.ConfigMap, opts metav1.UpdateOptions) error DeleteConfigMap(ctx context.Context, namespace string, name string, opts metav1.DeleteOptions) error }
type Option ¶
type Option func(*option)
func WithAppLabel ¶
func WithBaseBranchLabel ¶
func WithCreatedByLabel ¶
func WithEnvirionmentLabel ¶
func WithImagePullPolicy ¶
func WithLabelSelector ¶
func WithPrIDLabel ¶
func WithReplica ¶
func WithRepositoryLabel ¶
Click to show internal directories.
Click to hide internal directories.