mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-12-04 18:36:26 +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
|
||||
AllowStreamBranches bool
|
||||
FsCreator FsCreatorFunc
|
||||
CdnUrl string
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ func (g *GitMode) WriteSource(pd *data.ProcessData, md *data.ModeData) error {
|
||||
body = fromBlobStorage
|
||||
log.Printf("downloading %s from blob storage", hash)
|
||||
} 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)
|
||||
|
||||
req, err := http.NewRequest("GET", url, nil)
|
||||
|
@ -83,6 +83,7 @@ type ProcessDataRequest struct {
|
||||
NoStorageUpload bool
|
||||
NoStorageDownload bool
|
||||
SingleTag string
|
||||
CdnUrl string
|
||||
}
|
||||
|
||||
func gitlabify(str string) string {
|
||||
@ -126,6 +127,9 @@ func NewProcessData(req *ProcessDataRequest) (*data.ProcessData, error) {
|
||||
if req.BranchPrefix == "" {
|
||||
req.BranchPrefix = "r"
|
||||
}
|
||||
if req.CdnUrl == "" {
|
||||
req.CdnUrl = "https://git.centos.org/sources"
|
||||
}
|
||||
|
||||
// Validate required
|
||||
if req.Package == "" {
|
||||
|
Loading…
Reference in New Issue
Block a user