diff --git a/cmd/srpmproc/main.go b/cmd/srpmproc/main.go index da185a1..c8a993b 100644 --- a/cmd/srpmproc/main.go +++ b/cmd/srpmproc/main.go @@ -17,7 +17,8 @@ var ( upstreamPrefix string branch string gcsBucket string - debrandedTarballs []string + gitCommitterName string + gitCommitterEmail string ) var root = &cobra.Command{ @@ -40,12 +41,14 @@ func mn(_ *cobra.Command, _ []string) { } internal.ProcessRPM(&internal.ProcessData{ - RpmLocation: sourceRpmLocation, - UpstreamPrefix: upstreamPrefix, - SshKeyLocation: sshKeyLocation, - SshUser: sshUser, - Branch: branch, - Bucket: client.Bucket(gcsBucket), + RpmLocation: sourceRpmLocation, + UpstreamPrefix: upstreamPrefix, + SshKeyLocation: sshKeyLocation, + SshUser: sshUser, + Branch: branch, + Bucket: client.Bucket(gcsBucket), + GitCommitterName: gitCommitterName, + GitCommitterEmail: gitCommitterEmail, }) } @@ -58,10 +61,11 @@ func main() { _ = root.MarkFlagRequired("branch") root.Flags().StringVar(&gcsBucket, "gcs-bucket", "", "Bucket to use as blob storage") _ = root.MarkFlagRequired("gcs-bucket") + root.Flags().StringVar(&gitCommitterName, "git-committer-name", "distrobuild-bot", "Name of committer") + root.Flags().StringVar(&gitCommitterEmail, "git-committer-email", "mustafa+distrobuild@bycrates.com", "Email of committer") - root.Flags().StringVar(&sshKeyLocation, "ssh-key-location", "", "Location of the SSH key to use to authenticate against upstream (Optional)") - root.Flags().StringVar(&sshUser, "ssh-user", "git", "SSH User (Optional, default git)") - root.Flags().StringArrayVar(&debrandedTarballs, "debranded-tarball", []string{}, "GCS urls to debranded tarballs (stage 2) (Optional)") + root.Flags().StringVar(&sshKeyLocation, "ssh-key-location", "", "Location of the SSH key to use to authenticate against upstream") + root.Flags().StringVar(&sshUser, "ssh-user", "git", "SSH User") if err := root.Execute(); err != nil { log.Fatal(err) diff --git a/internal/process.go b/internal/process.go index 5cfa448..90fbbea 100644 --- a/internal/process.go +++ b/internal/process.go @@ -29,12 +29,14 @@ import ( ) type ProcessData struct { - RpmLocation string - UpstreamPrefix string - SshKeyLocation string - SshUser string - Branch string - Bucket *storage.BucketHandle + RpmLocation string + UpstreamPrefix string + SshKeyLocation string + SshUser string + Branch string + Bucket *storage.BucketHandle + GitCommitterName string + GitCommitterEmail string } func strContains(a []string, b string) bool { @@ -401,8 +403,8 @@ func ProcessRPM(pd *ProcessData) { // create import commit commit, err := w.Commit("import "+filepath.Base(pd.RpmLocation), &git.CommitOptions{ Author: &object.Signature{ - Name: "Mustafa Gezen", - Email: "mustafa@bycrates.com", + Name: pd.GitCommitterName, + Email: pd.GitCommitterEmail, When: time.Now(), }, Parents: hashes,