gerrit

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package gerrit provides gerrit utilities

Index

Constants

This section is empty.

Variables

View Source
var CreateCIUserScript string
View Source
var CreateRepoScript string
View Source
var GerritCmd = &cobra.Command{
	Use:   "gerrit",
	Short: "Deploy a demo Gerrit instance to hack on sf-operator",
	Run: func(cmd *cobra.Command, args []string) {
		deploy, _ := cmd.Flags().GetBool("deploy")
		wipe, _ := cmd.Flags().GetBool("wipe")
		fqdn, _ := cmd.Flags().GetString("fqdn")

		if !(deploy || wipe) {
			println("Select one of deploy or wipe option")
			os.Exit(1)
		}

		cl := utils.CreateKubernetesClientOrDie("")
		ctx := context.Background()
		env := utils.ENV{
			Cli: cl,
			Ns:  ns,
			Ctx: ctx,
		}
		if deploy {
			fmt.Println("Ensure Gerrit deployed in namespace", ns)
			EnsureGerrit(&env, fqdn)
			fmt.Printf("Gerrit is available at https://gerrit.%s\n", fqdn)
		}

		if wipe {
			fmt.Println("Wipe Gerrit from namespace", ns)

			WipeGerrit(&env)
		}

	},
}
View Source
var ManageSFVolumes = []apiv1.Volume{
	base.MkVolumeCM(managesfResourcesIdent+"-config-vol",
		managesfResourcesIdent+"-config-map"),
	{
		Name: managesfResourcesIdent + "-tooling-vol",
		VolumeSource: apiv1.VolumeSource{
			ConfigMap: &apiv1.ConfigMapVolumeSource{
				LocalObjectReference: apiv1.LocalObjectReference{
					Name: managesfResourcesIdent + "-tooling-config-map",
				},
				DefaultMode: &cutils.Execmod,
			},
		},
	},
}

Functions

func EnsureGerrit

func EnsureGerrit(env *utils.ENV, fqdn string)

func GenerateManageSFConfig

func GenerateManageSFConfig(gerritadminpassword string, fqdn string) string

func GerritHttpdService

func GerritHttpdService(ns string) apiv1.Service

func GerritInitContainers

func GerritInitContainers(volumeMounts []apiv1.VolumeMount, fqdn string) apiv1.Container

func GerritPostInitContainer

func GerritPostInitContainer(jobName string, fqdn string) apiv1.Container

func GerritSshdService

func GerritSshdService(ns string) apiv1.Service

func SetGerritMSFRContainer

func SetGerritMSFRContainer(sts *appsv1.StatefulSet, fqdn string)

func SetGerritSTSContainer

func SetGerritSTSContainer(sts *appsv1.StatefulSet, volumeMounts []apiv1.VolumeMount, fqdn string)

func SetGerritSTSVolumes

func SetGerritSTSVolumes(sts *appsv1.StatefulSet)

func WipeGerrit

func WipeGerrit(env *utils.ENV)

Types

type GerritCMDContext

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

Jump to

Keyboard shortcuts

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