GitLab CI: Pipelines, CI/CD and DevOps for Beginners

Create new project in gitlab and name it ray test car assemble line -> new file -> .gitlab-ci.yml

build the car:

script:

- mkdir build

- cd build

- touch car.txt

- echo "chassis" > car.txt

- echo "engine" > car.txt

- echo "wheels" > car.txt

Add a test stage

stages:

- build

- test



build the car:

stage: build

script:

- mkdir build

- cd build

- touch car.txt

- echo "chassis" > car.txt

- echo "engine" >> car.txt

- echo "wheels" >> car.txt

- pwd

- ls

artifacts:

paths:

- build/


test the car:

stage: test

script:

- pwd

- ls

- test -f build/car.txt

- cd build

- ls

- grep "chassis" car.txt

- grep "engine" car.txt

- grep "wheels" car.txt

You can download job artifacts when debugging