cmd

package
v0.0.0-...-ea9d009 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2019 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Copyright © 2017 CoreOS Inc 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

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "issue-sync [options]",
	Short: "A tool to synchronize GitHub and JIRA issues",
	Long:  "Full docs coming later; see https://github.com/coreos/issue-sync",
	RunE: func(cmd *cobra.Command, args []string) error {
		config, err := cfg.NewConfig(cmd)
		if err != nil {
			return err
		}

		log := config.GetLogger()

		jiraClient, err := clients.NewJIRAClient(&config)
		if err != nil {
			return err
		}
		ghClient, err := clients.NewGitHubClient(config)
		if err != nil {
			return err
		}

		for {
			if err := lib.CompareIssues(config, ghClient, jiraClient); err != nil {
				log.Error(err)
			}
			if !config.IsDryRun() {
				if err := config.SaveConfig(); err != nil {
					log.Error(err)
				}
			}
			if !config.IsDaemon() {
				return nil
			}
			<-time.After(config.GetDaemonPeriod())
		}
	},
}

RootCmd represents the command itself and configures it.

View Source
var Version = "undefined"

Functions

func Execute

func Execute()

Execute provides a single function to run the root command and handle errors.

Types

This section is empty.

Jump to

Keyboard shortcuts

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