File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,34 @@ There are some high level differences between the products worth mentioning:
30
30
- GitLab comes with a [ container registry] ( ../../user/project/container_registry.md ) , and we recommend using
31
31
container images to set up your build environment.
32
32
33
+ ## Groovy vs. YAML
34
+
35
+ Jenkins Pipelines are based on [ Groovy] ( https://groovy-lang.org/ ) , so the pipeline specification is written as code.
36
+ GitLab works a bit differently, we use the more highly structured [ YAML] ( https://yaml.org/ ) format, which
37
+ places scripting elements inside of ` script: ` blocks separate from the pipeline specification itself.
38
+
39
+ This is a strength of GitLab, in that it helps keep the learning curve much simpler to get up and running
40
+ and avoids some of the problem of unconstrained complexity which can make your Jenkinsfiles hard to understand
41
+ and manage.
42
+
43
+ That said, we do of course still value DRY (don't repeat yourself) principles and want to ensure that
44
+ behaviors of your jobs can be codified once and applied as needed. You can use the ` extends: ` syntax to
45
+ [ templatize your jobs] ( ../yaml/README.md#extends ) , and ` include: ` can be used to [ bring in entire sets of behaviors] ( ../yaml/README.md#include )
46
+ to pipelines in different projects.
47
+
48
+ ``` yaml
49
+ .in-docker :
50
+ tags :
51
+ - docker
52
+ image : alpine
53
+
54
+ rspec :
55
+ extends :
56
+ - .in-docker
57
+ script :
58
+ - rake rspec
59
+ ` ` `
60
+
33
61
## Artifact publishing
34
62
35
63
Artifacts may work a bit differently than you've used them with Jenkins. In GitLab, any job can define
You can’t perform that action at this time.
0 commit comments