Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Tar log files together if there are too many of them to avoid cluttering... #3

Open
wants to merge 1 commit into from

2 participants

Zoltan Varga Rolf Bjarne Kvinge
Zoltan Varga
Owner
vargaz commented

... the UI.

Rolf Bjarne Kvinge
Owner

This should be done in the scripts, not in MonkeyWrench. Logs aren't the only thing uploaded, it can be anything (tarballs, dmgs, msis, images, etc) - and files can be accessed externally (I believe this will break the release pipeline for instance - it fetches files using filenames and won't handle those files being put in tarballs all of a sudden).

Owner

Alternatively it can be decluttered in the web ui, maybe hide/show the file links using js if there are many of them

Owner

There could be multiple approaches, this is the one I could some up with, since I don't know anything about JS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jun 07, 2012
Zoltan Varga vargaz Tar log files together if there are too many of them to avoid clutter…
…ing the UI.
cf22a16
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 19 additions and 1 deletion. Show diff stats Hide diff stats

  1. +19 1 MonkeyWrench.Builder/Builder.cs
20 MonkeyWrench.Builder/Builder.cs
@@ -447,12 +447,30 @@ private static void Build (BuildInfo info)
447 447 // Gather files from logged commands and from the upload_files glob
448 448 CheckLog (log_file, info);
449 449 if (!string.IsNullOrEmpty (info.command.upload_files)) {
  450 + List<string> archive_files = new List<string> ();
450 451 foreach (string glob in info.command.upload_files.Split (',')) {
451 452 // TODO: handle globs in directory parts
452 453 // TODO: allow absolute paths?
453 454 Logger.Log ("Uploading files from glob {0}", glob);
454 455 // TODO: allow hidden files also
455   - WebService.UploadFilesSafe (info.work, Directory.GetFiles (Path.Combine (info.BUILDER_DATA_SOURCE_DIR, Path.GetDirectoryName (glob)), Path.GetFileName (glob)), null);
  456 + var dir = Path.Combine (info.BUILDER_DATA_SOURCE_DIR, Path.GetDirectoryName (glob));
  457 + var files = Directory.GetFiles (dir, Path.GetFileName (glob));
  458 + if (files.Length > 10) {
  459 + foreach (string s in files)
  460 + archive_files.Add (s);
  461 + } else {
  462 + WebService.UploadFilesSafe (info.work, files, null);
  463 + }
  464 + }
  465 + if (archive_files.Count > 0) {
  466 + // Zip them together to make them easier to handle
  467 + var log_archive = Path.Combine (info.BUILDER_DATA_SOURCE_DIR, "wrench-logs.tar");
  468 + File.Delete (log_archive);
  469 + foreach (var f in archive_files) {
  470 + var p = Process.Start ("tar", "rvf " + log_archive + " " + f);
  471 + p.WaitForExit ();
  472 + }
  473 + WebService.UploadFilesSafe (info.work, new string[] { log_archive }, null);
456 474 }
457 475 }
458 476

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.