mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-06-02 08:10:17 +00:00
enhancement: make cdn url configurable during import
This commit is contained in:
parent
fff8896c47
commit
360c4d5849
|
@ -53,4 +53,5 @@ type ProcessData struct {
|
||||||
ModuleFallbackStream string
|
ModuleFallbackStream string
|
||||||
AllowStreamBranches bool
|
AllowStreamBranches bool
|
||||||
FsCreator FsCreatorFunc
|
FsCreator FsCreatorFunc
|
||||||
|
CdnUrl string
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,7 +240,7 @@ func (g *GitMode) WriteSource(pd *data.ProcessData, md *data.ModeData) error {
|
||||||
body = fromBlobStorage
|
body = fromBlobStorage
|
||||||
log.Printf("downloading %s from blob storage", hash)
|
log.Printf("downloading %s from blob storage", hash)
|
||||||
} else {
|
} else {
|
||||||
url := fmt.Sprintf("https://git.centos.org/sources/%s/%s/%s", md.Name, branchName, hash)
|
url := fmt.Sprintf("%s/%s/%s/%s", pd.CdnUrl, md.Name, branchName, hash)
|
||||||
log.Printf("downloading %s", url)
|
log.Printf("downloading %s", url)
|
||||||
|
|
||||||
req, err := http.NewRequest("GET", url, nil)
|
req, err := http.NewRequest("GET", url, nil)
|
||||||
|
|
|
@ -83,6 +83,7 @@ type ProcessDataRequest struct {
|
||||||
NoStorageUpload bool
|
NoStorageUpload bool
|
||||||
NoStorageDownload bool
|
NoStorageDownload bool
|
||||||
SingleTag string
|
SingleTag string
|
||||||
|
CdnUrl string
|
||||||
}
|
}
|
||||||
|
|
||||||
func gitlabify(str string) string {
|
func gitlabify(str string) string {
|
||||||
|
@ -126,6 +127,9 @@ func NewProcessData(req *ProcessDataRequest) (*data.ProcessData, error) {
|
||||||
if req.BranchPrefix == "" {
|
if req.BranchPrefix == "" {
|
||||||
req.BranchPrefix = "r"
|
req.BranchPrefix = "r"
|
||||||
}
|
}
|
||||||
|
if req.CdnUrl == "" {
|
||||||
|
req.CdnUrl = "https://git.centos.org/sources"
|
||||||
|
}
|
||||||
|
|
||||||
// Validate required
|
// Validate required
|
||||||
if req.Package == "" {
|
if req.Package == "" {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user