From 4f6370c773b01b3164592aa224d25c69c3be9930 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Sat, 30 Apr 2022 13:51:04 -0400 Subject: gitlab-ci: Always preserve artifacts, even in failed jobs (cherry picked from commit fd08b0c91ea3cab39184f1b1b1aafcd63ce6973f) --- .gitlab/gen_ci.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to '.gitlab/gen_ci.hs') diff --git a/.gitlab/gen_ci.hs b/.gitlab/gen_ci.hs index b7b8e17fa0..40c5e29e98 100755 --- a/.gitlab/gen_ci.hs +++ b/.gitlab/gen_ci.hs @@ -394,6 +394,7 @@ data Artifacts = Artifacts { artifactPaths :: [String] , junitReport :: String , expireIn :: String + , artifactsWhen :: ArtifactsWhen } instance ToJSON Artifacts where @@ -403,8 +404,16 @@ instance ToJSON Artifacts where ] , "expire_in" A..= expireIn , "paths" A..= artifactPaths + , "when" A..= artifactsWhen ] +data ArtifactsWhen = ArtifactsOnSuccess | ArtifactsOnFailure | ArtifactsAlways + +instance ToJSON ArtifactsWhen where + toJSON ArtifactsOnSuccess = "on_success" + toJSON ArtifactsOnFailure = "on_failure" + toJSON ArtifactsAlways = "always" + ----------------------------------------------------------------------------- -- Rules, when do we run a job ----------------------------------------------------------------------------- @@ -594,6 +603,7 @@ job arch opsys buildConfig = (jobName, Job {..}) , expireIn = "2 weeks" , artifactPaths = [binDistName arch opsys buildConfig ++ ".tar.xz" ,"junit.xml"] + , artifactsWhen = ArtifactsAlways } jobCache -- cgit v1.2.1