2. Create a Simple Pipeline
Introduction
This section will walk through the steps of creating a basic CI/CD pipeline.
Create a Simple Pipeline
-
1. In your demo project, find the 2-setup-simple-pipeline
branch inCode > Branches
-
2. Next to the branch name, click New
to create a new Merge Request from this branch -
3. Click Create Merge Request
-
4. Review the newly added .gitlab-ci.yml file which is used to configure our pipeline - This pipeline contains two stages:
build
andtest
- Within the
build
stage, there is a single job namedbuild_app
that executes a set of commands via thebefore_script
andscript
keyword. - Within the
test
stage, the is a single job namedunit_test
that uses thebefore_script
keyword to add test packages, thescript
keyword to execute tests, andafter_script
keyword to echo that the test job has successfully run.
- This pipeline contains two stages:
-
5. Within the Merge Request, click Mark as Ready
in the Overview tab (if prompted), then clickMerge
. This will trigger a new pipeline using the newly added configurations to the .gitlab-ci.yml file. -
6. In the left hand navigation menu, click Build
->Pipelines
then click the link for the most recently ran pipeline (ex: #577244133) to view the status of the pipeline. -
7. Click the unit_test job to see the console output and look for the message echoed by the after_script