#1195 backend: put build-ID.log file to resultdir
Merged 4 years ago by thrnciar. Opened 4 years ago by praiskup.

@@ -178,7 +178,7 @@

                  failed = True

  

          if not self.reattach:

-             self.clean_result_directory(job)

+             self.prepare_result_directory(job)

  

          if not failed:

              # FIXME
@@ -324,11 +324,16 @@

              except IOError:

                  self.log.info("File %s not found", src)

  

-     def clean_result_directory(self, job):

+     def prepare_result_directory(self, job):

          """

          Create backup directory and move there results from previous build.

          """

-         if not os.path.exists(job.results_dir) or os.listdir(job.results_dir) == []:

+         try:

+             os.mkdir(job.results_dir)

+         except FileExistsError:

+             pass

+ 

+         if not os.listdir(job.results_dir):

              return

  

          backup_dir_name = "prev_build_backup"

file modified
+1 -1
@@ -114,7 +114,7 @@

  

      @property

      def chroot_log_path(self):

-         return os.path.join(self.chroot_dir, self.chroot_log_name)

+         return os.path.join(self.results_dir, self.chroot_log_name)

  

      @property

      def rsync_log_name(self):

The <owner>/<project>/<chroot> directory will have roughly half of the
entries.

rebased onto 9f7511fd77a4b04669a63f1c6d2bb18abbb61584

4 years ago

What do you think @frostyx ? Not really a blocker, but having this in this release would be nice.

So we won't be creating e.g.

/var/lib/copr/public_html/results/frostyx/foo/fedora-30-x86_64/build-00000001.log

but rather

/var/lib/copr/public_html/results/frostyx/foo/fedora-30-x86_64/00000001-hello/build-00000001.log

? I don't see any problem with that.

Except for the bug. I can not use target_dir_name :-( ... see updated patch.

rebased onto 2dbd728d52a557e919bd60ce5ee01548e07f14e7

4 years ago

if not os.listdir(job.results_dir) would be imho better

rebased onto 98ca83a145863494c62ded45a3720192cec16f15

4 years ago

we are in preparation for tomorrow's release, merging earlier than 24h+

rebased onto e4cfc06

4 years ago

Pull-Request has been merged by thrnciar

4 years ago