.gitlab-ci.yml: Use .extends to avoid duplication of autobuild command
authorAndrew Bartlett <abartlet@samba.org>
Wed, 13 Feb 2019 03:43:51 +0000 (16:43 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 14 Feb 2019 01:18:30 +0000 (02:18 +0100)
This should make our .gitlab-ci.yml file much less overwealming.

The downside is that $CI_JOB_NAME is printed rather than the job name
in the log, but the upside is that the names must now strictly match.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Tim Beale <timbeale@catalyst.net.nz>
.gitlab-ci-private.yml
.gitlab-ci.yml

index f42ec08b311f08c239ad098440e79b8606b30e2a..62fe15499b9d5b3193a107875484dd1b27d09eb7 100644 (file)
@@ -16,36 +16,23 @@ include:
 
 samba:
   extends: .private_template
-  script:
     # this one takes about 4 hours to finish
-    - script/autobuild.py samba            --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_py2:
+samba-py2:
   extends: .private_template
-  script:
     # this one takes about 4 hours to finish
-    - script/autobuild.py samba-py2            --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_fileserver:
+samba-fileserver:
   extends: .private_template
-  script:
     # this one takes about 1 hours to finish
-    - script/autobuild.py samba-fileserver --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_ad_dc:
+samba-ad-dc:
   extends: .private_template
-  script:
     # this one takes about 1 hours to finish
-    - script/autobuild.py samba-ad-dc     --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-
-samba_ad_dc_py2:
+samba-ad-dc-py2:
   extends: .private_template
-  script:
     # this one takes about 1 hours to finish
-    - script/autobuild.py samba-ad-dc-py2     --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-nt4:
+samba-nt4:
   extends: .private_template
-  script:
-    - script/autobuild.py samba-nt4 --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
index fec12c6760e91080c54bb863d72d164d9481ae1a..ec76313d4c6f0112e72cb6cd923e4f78a9628c70 100644 (file)
@@ -39,103 +39,71 @@ variables:
     when:
       - runner_system_failure
       - stuck_or_timeout_failure
+  script:
+    - script/autobuild.py $CI_JOB_NAME    --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_none_env:
+others:
   extends: .shared_template
   script:
+    - script/autobuild.py ldb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+    - script/autobuild.py pidl             --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+    - script/autobuild.py replace          --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+    - script/autobuild.py talloc           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+    - script/autobuild.py tdb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+    - script/autobuild.py tevent           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
+
+samba-none-env:
+  extends: .shared_template
     # this one takes about 1 hours to finish
-    - script/autobuild.py samba-none-env    --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_none_env_py2:
+samba-none-env-py2:
   extends: .shared_template
-  script:
     # this one takes about 1 hours to finish
-    - script/autobuild.py samba-none-env-py2    --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_nopython:
+samba-nopython:
   extends: .shared_template
-  script:
-    - script/autobuild.py samba-nopython   --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_systemkrb5:
+samba-systemkrb5:
   extends: .shared_template
-  script:
-    - script/autobuild.py samba-systemkrb5 --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_xc:
+samba-xc:
   extends: .shared_template
-  script:
-    - script/autobuild.py samba-xc         --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_o3:
+samba-o3:
   extends: .shared_template
-  script:
-    - script/autobuild.py samba-o3         --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_ad_dc_2:
+samba-ad-dc-2:
   extends: .shared_template
-  script:
     # this one takes about 1 hours to finish
-    - script/autobuild.py samba-ad-dc-2     --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_ad_dc_backup:
+samba-ad-dc-backup:
   extends: .shared_template
-  script:
-    - script/autobuild.py samba-ad-dc-backup    --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_ad_dc_2_py2:
+samba-ad-dc-2-py2:
   extends: .shared_template
-  script:
     # this one takes about 1 hours to finish
-    - script/autobuild.py samba-ad-dc-2-py2     --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_libs:
+samba-libs:
   extends: .shared_template
-  script:
-    - script/autobuild.py samba-libs       --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_libs_py2:
+samba-libs-py2:
   extends: .shared_template
-  script:
-    - script/autobuild.py samba-libs-py2       --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_static:
+samba-static:
   extends: .shared_template
-  script:
-    - script/autobuild.py samba-static     --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
 ctdb:
   extends: .shared_template
-  script:
-    - script/autobuild.py ctdb       --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_ctdb:
+samba-ctdb:
   extends: .shared_template
-  script:
-    - script/autobuild.py samba-ctdb             --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-
-others:
-  extends: .shared_template
-  script:
-    - script/autobuild.py ldb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-    - script/autobuild.py pidl             --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-    - script/autobuild.py replace          --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-    - script/autobuild.py talloc           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-    - script/autobuild.py tdb              --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
-    - script/autobuild.py tevent           --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_buildpy2_only:
+samba-buildpy2-only:
   extends: .shared_template
-  script:
-    - python script/autobuild.py samba-buildpy2-only             --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_ad_dc_ntvfs:
+samba-ad-dc-ntvfs:
   extends: .shared_template
-  script:
     # this one takes about 100 mins to finish
-    - script/autobuild.py samba-ad-dc-ntvfs --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase
 
-samba_ad_dc_ntvfs_py2:
+samba-ad-dc-ntvfs-py2:
   extends: .shared_template
-  script:
-    - script/autobuild.py samba-ad-dc-ntvfs-py2 --verbose --nocleanup --keeplogs --tail --testbase /tmp/samba-testbase