#4 Pipeline Automation
Create a .gitlab-ci.yml file to see CI in action
Theme
Build, test, & scan automation through GitLab CI/CD
Tasks and Steps
-
Enable GitLab CI/CD - Navigate to My-Group/My-Project
- Next to the Main branch dropdown, click the + dropdown menu and select New file
- Click the Select a template type dropdown and select .gitlab-ci.yml
- Click the Apply a template dropdown and select Bash
- Provide a Commit message and click Commit changes
-
Verify Pipeline Run & View Logs - Navigate to CI/CD -> Pipelines
- Confirm a new pipeline run is listed
- Select the pipeline by clicking on its status (pending, running, passed) or pipeline ID
Example: #525355261
- Pick a job that has started or passed and view the trace logs for the selected job
-
Add a new job - Navigate to CI/CD>Editor
- Using the test2 job as a guide, create another job called test3 that has script
cat README.md
- Click Visualize to visualize the new pipeline with the test3 job in the Test stage
- Provide a Commit message and click Commit changes
-
Verify new job executes - Click View pipeline or navigate to CI/CD>Pipelines and select the newly executed pipeline
- Click on the test3 job to view the trace logs and confirm the README.md contents are displayed