summaryrefslogtreecommitdiff
path: root/src/Job.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-11-05 21:14:01 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2025-11-05 21:14:01 +0100
commitebe120fcfffc6d4d8ca261cfef7699eac7fd94fe (patch)
tree0e907f05a3c434abe8c2a13d94f8980e01f7785d /src/Job.hs
parent164c2dc41dcdbda4df2f71cdced84f7831a049d0 (diff)
Store artifact work path along with data
Diffstat (limited to 'src/Job.hs')
-rw-r--r--src/Job.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Job.hs b/src/Job.hs
index 6a55db1..7db1645 100644
--- a/src/Job.hs
+++ b/src/Job.hs
@@ -329,8 +329,8 @@ runJob job uses checkoutPath jdir = do
| fromIntegral n == -sigINT -> throwError JobCancelled
| otherwise -> throwError JobFailed
- let adir = jdir </> "artifacts"
artifacts <- forM (jobArtifacts job) $ \( name@(ArtifactName tname), pathPattern ) -> do
+ let adir = jdir </> "artifacts" </> T.unpack tname
path <- liftIO (globDir1 pathPattern checkoutPath) >>= \case
[ path ] -> return path
found -> do
@@ -338,13 +338,15 @@ runJob job uses checkoutPath jdir = do
(if null found then "no file" else "multiple files") <> " found matching pattern ‘" <>
decompile pathPattern <> "’ for artifact ‘" <> T.unpack tname <> "’"
throwError JobFailed
- let target = adir </> T.unpack tname </> takeFileName path
+ let target = adir </> "data"
+ workPath = makeRelative checkoutPath path
liftIO $ do
createDirectoryIfMissing True $ takeDirectory target
copyRecursiveForce path target
+ writeFile (adir </> "path") workPath
return $ ArtifactOutput
{ aoutName = name
- , aoutWorkPath = makeRelative checkoutPath path
+ , aoutWorkPath = workPath
, aoutStorePath = target
}