Path: blob/main/components/ws-daemon/cmd/debug-run-initializer.go
2498 views
// Copyright (c) 2020 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34package cmd56import (7"context"89"github.com/gitpod-io/gitpod/common-go/log"10"github.com/gitpod-io/gitpod/content-service/api"11"github.com/gitpod-io/gitpod/content-service/pkg/storage"12"github.com/gitpod-io/gitpod/ws-daemon/pkg/content"13"github.com/spf13/cobra"14)1516// debugRunInitializer represents the generate command17var debugRunInitializer = &cobra.Command{18Use: "run-initializer",19Short: "Runs the content initializer",20Args: cobra.ExactArgs(1),21RunE: func(cmd *cobra.Command, args []string) error {22dst := args[0]23log.WithField("dst", dst).Info("running content initializer")24_, err := content.RunInitializer(context.Background(), dst, &api.WorkspaceInitializer{25Spec: &api.WorkspaceInitializer_Git{26Git: &api.GitInitializer{27RemoteUri: "https://github.com/gitpod-io/gitpod.git",28TargetMode: api.CloneTargetMode_REMOTE_BRANCH,29CloneTaget: "refs/heads/main",30CheckoutLocation: "foo",31Config: &api.GitConfig{32Authentication: api.GitAuthMethod_NO_AUTH,33},34},35},36}, make(map[string]storage.DownloadInfo), content.RunInitializerOpts{})37return err38},39}4041func init() {42debugCmd.AddCommand(debugRunInitializer)43}444546