Understanding Gitlab Pipelines - Creating CI - CD Flow
Understanding Gitlab Pipelines - Creating CI - CD Flow
WEB APPLICATIONS
Understanding Gitlab
Pipelines - Creating
CI/CD Flow
WOJCIECH MARUSARZ -
NOVEMBER 17, 2021
1 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
CI/CD (Continuous
Integration/Continuous
Delivery)
It is impossible to create a CI/CD pipeline on our local
machine.
2 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
Stories on software
engineering straight to your
inbox
3 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
4 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
Artifacts
5 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
Cache
6 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
CI/CD Variables
7 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
8 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
9 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
10 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
11 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
12 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
13 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
14 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
15 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
16 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
17 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
Uploading artifacts...
./artifact-file: found 1 matching files and directories
Uploading artifacts as "archive" to coordinator...
18 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
Let’s see how artifacts and cache �les (that are not
under source control) are used by GitLab pipelines
based on the example below.
First Pipeline
Let’s see the output of the very �rst run of the update
artifacts job. The same situation is for the very �rst run
of the update cache job.
19 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
$ ls
README.md
cache-key
$ if test -f ./cache-file; then cat ./cache-file; fi;
$ if test -f ./artifact-file; then cat ./artifact-file;
$ echo "artifact updated in job 1A, secret [$SECRET_KEY
As you can see, there are only two �les in the working
directory - these are �les from the repository -
*README.md *and cache-key. There is no cache-�le
nor artifact-�le.
$ ls
README.md
artifact-file
cache-file
cache-key
$ if test -f ./cache-file; then cat ./cache-file; fi;
cache created in job 1B, secret [secret_value], on branch [ma
$ if test -f ./artifact-file; then cat ./artifact-file;
artifact updated in job 1A, secret [secret_value], on branch
20 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
Second Pipeline
$ ls
README.md
cache-file
cache-key
$ if test -f ./cache-file; then cat ./cache-file; fi;
cache created in job 1B, secret [secret_value], on branch [ma
update cache in job 2A, secret [&SECRET_KEY], on branch [main
$ if test -f ./artifact-file; then cat ./artifact-file;
Third Pipeline
21 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
$ ls
README.md
cache-key
$ if test -f ./cache-file; then cat ./cache-file; fi;
$ if test -f ./artifact-file; then cat ./artifact-file;
22 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
References
https://docs.gitlab.com/ee/ci
https://docs.gitlab.com/runner
https://docs.gitlab.com/runner/executors
https://docs.gitlab.com/ee/ci/introduction/#gitlab-
cicd-work�ow
https://www.digitalocean.com/community/tutorials
/how-to-set-up-a-continuous-deployment-pipeline-
with-gitlab-ci-cd-on-ubuntu-18-04
23 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
https://medium.com/@ryzmen/gitlab-fast-
pipelines-stages-jobs-c51c829b9aa1
https://www.section.io/engineering-education
/building-a-cicd-pipeline-using-gitlab
24 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
Wojciech Marusarz
Software Engineer
Tempted to work
on something
as creative?
25 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
JOIN NEXOCODE �
26 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
27 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
3 6 ART ICLES
Zero Legacy
CHECK IT OUT �
28 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
Zero Legacy
First Name
Last Name
Your Email
with AI
Subscribe to our newsletter
Follow us
SERVICES
AI Design Sprint
AI Consulting Services
SOLUTIONS
Computer Vision
Predictive Analytics
Recommendation Systems
30 of 31 12/31/2023, 8:45 PM
Understanding Gitlab Pipelines - Creating CI/CD Flow https://nexocode.com/blog/posts/understanding-principles-of-gitlab-ci-c...
RESOURCES
AI Design Sprint
INDUSTRIES
AI in Logistics
AI in Pharma
COMPANY
About us
Blog
Careers
Case Studies
Contact
nexocode
ul. Wadowicka 7
31 of 31 12/31/2023, 8:45 PM