public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] gitlab-ci: Add full nightly build
@ 2019-09-30 12:20 Jan Kiszka
  2019-10-01  6:11 ` Jan Kiszka
  2019-10-24 12:30 ` Baurzhan Ismagulov
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Kiszka @ 2019-09-30 12:20 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

Add a job that can be scheduled for nightly build. It performs a full CI
run, but only if its commit SHA wasn't tried to build yet.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

I've now set up our CI to perform this for jan/next.

 .gitlab-ci.yml | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5c64adc..dd6e12b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,17 +3,38 @@ image: kasproject/kas-isar:latest
 variables:
   GIT_STRATEGY: clone
 
-all:
+.common-build: &common-build
   stage: build
-  script:
+  before_script:
     - export http_proxy=$HTTP_PROXY
     - export https_proxy=$HTTPS_PROXY
     - export ftp_proxy=$FTP_PROXY
     - export no_proxy=$NO_PROXY
-    - scripts/ci_build.sh -q -f
   artifacts:
     name: "logs-$CI_JOB_ID"
     paths:
       - build/tmp/work/*/*/*/temp
     when: on_failure
     expire_in: 1 week
+
+fast-ci:
+  <<: *common-build
+  except:
+    - schedules
+  script:
+    - scripts/ci_build.sh -q -f
+
+full-ci:
+  <<: *common-build
+  only:
+    - schedules
+  script:
+    - PREVIOUS_SHA="$(cat .CI_COMMIT_SHA || true)"
+    - if [ "$CI_COMMIT_SHA" != "$PREVIOUS_SHA" ]; then
+          echo "$CI_COMMIT_SHA" > .CI_COMMIT_SHA;
+          scripts/ci_build.sh -q -c -r -s;
+      fi
+  cache:
+    key: "$CI_COMMIT_REF_SLUG"
+    paths:
+      - .CI_COMMIT_SHA
-- 
2.16.4


-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gitlab-ci: Add full nightly build
  2019-09-30 12:20 [PATCH] gitlab-ci: Add full nightly build Jan Kiszka
@ 2019-10-01  6:11 ` Jan Kiszka
  2019-10-24 12:30 ` Baurzhan Ismagulov
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kiszka @ 2019-10-01  6:11 UTC (permalink / raw)
  To: isar-users

On 30.09.19 14:20, [ext] Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Add a job that can be scheduled for nightly build. It performs a full CI
> run, but only if its commit SHA wasn't tried to build yet.
> 

More precisely, only successful builds count. I was hoping that the cache would 
be filled unconditionally, but that's only the case when the job succeeded.

Anyway, rerunning has a use case as well: failing network connections.

Jan

> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 
> I've now set up our CI to perform this for jan/next.
> 
>   .gitlab-ci.yml | 27 ++++++++++++++++++++++++---
>   1 file changed, 24 insertions(+), 3 deletions(-)
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index 5c64adc..dd6e12b 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -3,17 +3,38 @@ image: kasproject/kas-isar:latest
>   variables:
>     GIT_STRATEGY: clone
>   
> -all:
> +.common-build: &common-build
>     stage: build
> -  script:
> +  before_script:
>       - export http_proxy=$HTTP_PROXY
>       - export https_proxy=$HTTPS_PROXY
>       - export ftp_proxy=$FTP_PROXY
>       - export no_proxy=$NO_PROXY
> -    - scripts/ci_build.sh -q -f
>     artifacts:
>       name: "logs-$CI_JOB_ID"
>       paths:
>         - build/tmp/work/*/*/*/temp
>       when: on_failure
>       expire_in: 1 week
> +
> +fast-ci:
> +  <<: *common-build
> +  except:
> +    - schedules
> +  script:
> +    - scripts/ci_build.sh -q -f
> +
> +full-ci:
> +  <<: *common-build
> +  only:
> +    - schedules
> +  script:
> +    - PREVIOUS_SHA="$(cat .CI_COMMIT_SHA || true)"
> +    - if [ "$CI_COMMIT_SHA" != "$PREVIOUS_SHA" ]; then
> +          echo "$CI_COMMIT_SHA" > .CI_COMMIT_SHA;
> +          scripts/ci_build.sh -q -c -r -s;
> +      fi
> +  cache:
> +    key: "$CI_COMMIT_REF_SLUG"
> +    paths:
> +      - .CI_COMMIT_SHA
> 

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gitlab-ci: Add full nightly build
  2019-09-30 12:20 [PATCH] gitlab-ci: Add full nightly build Jan Kiszka
  2019-10-01  6:11 ` Jan Kiszka
@ 2019-10-24 12:30 ` Baurzhan Ismagulov
  1 sibling, 0 replies; 3+ messages in thread
From: Baurzhan Ismagulov @ 2019-10-24 12:30 UTC (permalink / raw)
  To: isar-users

On Mon, Sep 30, 2019 at 02:20:13PM +0200, Jan Kiszka wrote:
> Add a job that can be scheduled for nightly build. It performs a full CI
> run, but only if its commit SHA wasn't tried to build yet.

Applied to next, thanks.

With kind regards,
Baurzhan.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-24 12:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-30 12:20 [PATCH] gitlab-ci: Add full nightly build Jan Kiszka
2019-10-01  6:11 ` Jan Kiszka
2019-10-24 12:30 ` Baurzhan Ismagulov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox