From b1888e516c9c9d750726318227bf69856ec91b8b Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 31 Aug 2018 21:41:53 +0300 Subject: Add ci-load --- brep/handler/ci/ci-dir.in | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'brep/handler/ci/ci-dir.in') diff --git a/brep/handler/ci/ci-dir.in b/brep/handler/ci/ci-dir.in index 6a4f0af..2915b25 100644 --- a/brep/handler/ci/ci-dir.in +++ b/brep/handler/ci/ci-dir.in @@ -6,13 +6,18 @@ # Simple package CI request handler with directory storage. # -# Keep the CI request directory unless simulating. Write the CI result -# manifest to stdout. +# Dump the repositories.manifest and packages.manifest files into the CI +# request data directory as a sanity check. Keep the directory unless +# simulating. Write the CI result manifest to stdout. # usage="usage: $0 " verbose= #true +# Repository information fetch timeout (seconds). +# +fetch_timeout=60 + trap "{ exit 1; }" ERR set -o errtrace # Trap ERR in functions. @@ -80,14 +85,20 @@ fi spec="$spec$repository" +# Exit with the 'CI request is queued' response if simulating. +# +# Note that we can't assume a real repository URL is specified if simulating +# so trying to query the repository info is not a good idea. +# if [ -n "$simulate" ]; then - rm -r "$data_dir" + run rm -r "$data_dir" trace "CI request for '$spec' is simulated" else + dump_repository_manifests "$repository" "$data_dir" "$fetch_timeout" trace "CI request for '$spec' is queued" fi -# The spec normally contains the full commit id and so feels too hairy for -# including in the message. +# The spec normally contains the full commit id and so feels too hairy to +# include in the result manifest message. # exit_with_manifest 200 "CI request is queued" -- cgit v1.1