Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Lab-GitLab-CI-CD
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LSDS
Teaching
Bachelor
Cloud-and-Deployment
Lab-GitLab-CI-CD
Commits
1000f4c8
Commit
1000f4c8
authored
2 years ago
by
marcoemi.poleggi
Browse files
Options
Downloads
Patches
Plain Diff
Update README.md
parent
c08eb87c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+18
-22
18 additions, 22 deletions
README.md
with
18 additions
and
22 deletions
README.md
+
18
−
22
View file @
1000f4c8
...
@@ -2,10 +2,6 @@
...
@@ -2,10 +2,6 @@
Simple app deployment exercise (DevOps) with GitLab CI/CD.
Simple app deployment exercise (DevOps) with GitLab CI/CD.
## Pedagogical objectives ##
*
Become familiar with DevOps practices
*
Learn how to automatically deploy things via GitLab CD/CD
## Scenario ##
## Scenario ##
...
@@ -40,10 +36,6 @@ is playing:
...
@@ -40,10 +36,6 @@ is playing:
## Tasks ##
## Tasks ##
In this lab you will perform a number of tasks and document your progress in a
lab report. Each task specifies one or more deliverables to be
produced. Collect all the deliverables in your lab report.
**N.B.**
Some tasks require interacting with your local machine's OS: any
**N.B.**
Some tasks require interacting with your local machine's OS: any
related commands are supposed to be run into a terminal with the following
related commands are supposed to be run into a terminal with the following
conventions about the
*command line prompt*
:
conventions about the
*command line prompt*
:
...
@@ -58,21 +50,26 @@ conventions about the *command line prompt*:
...
@@ -58,21 +50,26 @@ conventions about the *command line prompt*:
**Goal:**
set up your GitLab CI/CD via its Web GUI.
**Goal:**
set up your GitLab CI/CD via its Web GUI.
Our GitLab instance comes with a shared Docker-based CI/CD
*runner*
.
Fork this project into your personal namespace and configure it (menu
`Settings`
):
-
In
`General > Visibility,...`
:
*
[x]
`Repository > CI/CD:`
active with "Only project members" (or empty)
*
[x]
`Operations`
: active with "Only project members" (or empty)
Deploy
[
SSH keys for the Docker
Our GitLab instance comes with a shared Docker-based CI/CD
*runner*
(or executor).
executor
](
https://docs.gitlab.com/ee/ci/ssh_keys/
)
. :bulb: All secrets should
Generate your
[
SSH key pair
](
https://docs.gitlab.com/ee/ci/ssh_keys/
)
to interact with your VM instance.
be
**protected**
and possibly
**masked**
. The following variables have to be added:
`SSH_PRIVATE_KEY`
,
`SSH_KNOWN_HOSTS`
and
`PRODUCTION_IP`
.
Configure the CI/CD system as it follows in section
**
Settings > CI/CD >
Configure the CI/CD system as it follows (menu
`Settings > CI/CD`
):
General pipelines
**
:
-
In
`General pipelines`
:
-
[ ] Public pipelines
*
[ ]
`Public pipelines`
-
[x] Auto-cancel redundant pipelines
*
[x]
`Auto-cancel redundant pipelines`
-
[x] Skip outdated deployment jobs
*
[x]
`Skip outdated deployment jobs`
-
Git strategy: fetch
*
`Git strategy:`
fetch
-
Git shallow clone: 1
*
`Git shallow clone:`
1
-
Timeout: 10m
*
`Timeout:`
10m
-
In
`Runners`
:
*
[x]
`Enable shared runners...`
-
In
`Variables`
: add the following variables:
`SSH_PRIVATE_KEY`
,
`SSH_KNOWN_HOSTS`
and
`PRODUCTION_IP`
.
:bulb: All secrets should be
**protected**
and possibly
**masked**
(SSH public keys cannot by masked).
### Task #2: CI/CD pipeline ###
### Task #2: CI/CD pipeline ###
...
@@ -100,7 +97,6 @@ before_script:
...
@@ -100,7 +97,6 @@ before_script:
unit_test1:
unit_test1:
stage: test
stage: test
script:
script:
-
# clone our repo locally
-
# check the app version number and exit != 0 if it's wrong
-
# check the app version number and exit != 0 if it's wrong
deploy_prod:
deploy_prod:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment