mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-09-27 20:34:09 +00:00
use git committer info from flags
This commit is contained in:
parent
1f0742889d
commit
e55e442aea
@ -17,7 +17,8 @@ var (
|
|||||||
upstreamPrefix string
|
upstreamPrefix string
|
||||||
branch string
|
branch string
|
||||||
gcsBucket string
|
gcsBucket string
|
||||||
debrandedTarballs []string
|
gitCommitterName string
|
||||||
|
gitCommitterEmail string
|
||||||
)
|
)
|
||||||
|
|
||||||
var root = &cobra.Command{
|
var root = &cobra.Command{
|
||||||
@ -46,6 +47,8 @@ func mn(_ *cobra.Command, _ []string) {
|
|||||||
SshUser: sshUser,
|
SshUser: sshUser,
|
||||||
Branch: branch,
|
Branch: branch,
|
||||||
Bucket: client.Bucket(gcsBucket),
|
Bucket: client.Bucket(gcsBucket),
|
||||||
|
GitCommitterName: gitCommitterName,
|
||||||
|
GitCommitterEmail: gitCommitterEmail,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,10 +61,11 @@ func main() {
|
|||||||
_ = root.MarkFlagRequired("branch")
|
_ = root.MarkFlagRequired("branch")
|
||||||
root.Flags().StringVar(&gcsBucket, "gcs-bucket", "", "Bucket to use as blob storage")
|
root.Flags().StringVar(&gcsBucket, "gcs-bucket", "", "Bucket to use as blob storage")
|
||||||
_ = root.MarkFlagRequired("gcs-bucket")
|
_ = 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(&sshKeyLocation, "ssh-key-location", "", "Location of the SSH key to use to authenticate against upstream")
|
||||||
root.Flags().StringVar(&sshUser, "ssh-user", "git", "SSH User (Optional, default git)")
|
root.Flags().StringVar(&sshUser, "ssh-user", "git", "SSH User")
|
||||||
root.Flags().StringArrayVar(&debrandedTarballs, "debranded-tarball", []string{}, "GCS urls to debranded tarballs (stage 2) (Optional)")
|
|
||||||
|
|
||||||
if err := root.Execute(); err != nil {
|
if err := root.Execute(); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
@ -35,6 +35,8 @@ type ProcessData struct {
|
|||||||
SshUser string
|
SshUser string
|
||||||
Branch string
|
Branch string
|
||||||
Bucket *storage.BucketHandle
|
Bucket *storage.BucketHandle
|
||||||
|
GitCommitterName string
|
||||||
|
GitCommitterEmail string
|
||||||
}
|
}
|
||||||
|
|
||||||
func strContains(a []string, b string) bool {
|
func strContains(a []string, b string) bool {
|
||||||
@ -401,8 +403,8 @@ func ProcessRPM(pd *ProcessData) {
|
|||||||
// create import commit
|
// create import commit
|
||||||
commit, err := w.Commit("import "+filepath.Base(pd.RpmLocation), &git.CommitOptions{
|
commit, err := w.Commit("import "+filepath.Base(pd.RpmLocation), &git.CommitOptions{
|
||||||
Author: &object.Signature{
|
Author: &object.Signature{
|
||||||
Name: "Mustafa Gezen",
|
Name: pd.GitCommitterName,
|
||||||
Email: "mustafa@bycrates.com",
|
Email: pd.GitCommitterEmail,
|
||||||
When: time.Now(),
|
When: time.Now(),
|
||||||
},
|
},
|
||||||
Parents: hashes,
|
Parents: hashes,
|
||||||
|
Loading…
Reference in New Issue
Block a user