Skip to content

Commit

Permalink
Allow overriding max age for recent releases (#497)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
  • Loading branch information
daniel-beck and daniel-beck authored Mar 20, 2021
1 parent 2cf38fa commit c0c76c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions site/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ unzip -q "$MAIN_DIR"/tmp/generator-$version.zip -d "$MAIN_DIR"/tmp/generator/
function execute {
# To use a locally built snapshot, use the following line instead:
# java -Dfile.encoding=UTF-8 -jar target/update-center2-*-bin/update-center2-*.jar "$@"
# Commonly provided system properties:
# -DRECENT_RELEASES_MAX_AGE_HOURS=30 in case the build failed for a while
# -DCERTIFICATE_MINIMUM_VALID_DAYS=14 in case the cert is about to expire
java -DCERTIFICATE_MINIMUM_VALID_DAYS=14 -Dfile.encoding=UTF-8 -jar "$MAIN_DIR"/tmp/generator/update-center2-*.jar "$@"
# TODO once we have a new cert, no longer override the duration
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import io.jenkins.update_center.HPI;
import io.jenkins.update_center.MavenRepository;
import io.jenkins.update_center.Plugin;
import io.jenkins.update_center.util.Environment;

import java.io.IOException;
import java.time.Duration;
Expand All @@ -27,5 +28,5 @@ public RecentReleasesRoot(MavenRepository repository) throws IOException {
}
}

private static final Duration MAX_AGE = Duration.ofHours(3);
private static final Duration MAX_AGE = Duration.ofHours(Environment.getInteger("RECENT_RELEASES_MAX_AGE_HOURS", 3));
}

0 comments on commit c0c76c2

Please sign in to comment.