@@ 624,14 624,27 @@ func (ctx *JobContext) UploadArtifacts() error {
if len(ctx.Manifest.Artifacts) == 0 {
return nil
}
- if len(ctx.Manifest.Artifacts) > 8 {
+ var (
+ ok bool
+ err error
+ artifactCount string
+ maxArtifacts int
+ )
+
+ if artifactCount, ok = config.Get("builds.sr.ht::worker", "max-artifacts"); !ok {
+ // default to old hardcoded value if the key wasn't found in the config file
+ artifactCount = "8"
+ }
+ if maxArtifacts, err = strconv.Atoi(artifactCount); err != nil {
+ return errors.New("The maximum build-artifact count could not be read")
+ }
+ if len(ctx.Manifest.Artifacts) > maxArtifacts {
ctx.Log.Println("Error: no more than 8 artifacts " +
"per build are accepted.")
return nil
}
var (
- ok bool
upstream string
accessKey string
secretKey string
@@ 639,7 652,7 @@ func (ctx *JobContext) UploadArtifacts() error {
prefix string
location string
)
- err := errors.New("Build artifacts were requested, but S3 " +
+ err = errors.New("Build artifacts were requested, but S3 " +
"is not configured for this build runner.")
if upstream, ok = config.Get("objects", "s3-upstream"); !ok || upstream == "" {
return err