|tools| Gitlab CICD pipline

I want to construct a pipeline to
– autobuild
– auto flash images
– auto test

Gitlab can do it well.
the following is my notes for building the pipeline.

Step 1. Setting gitlab
Most of this step is refering from
https://blog.wu-boy.com/2015/12/install-gitlab-on-debian-7-8/

Download from
https://about.gitlab.com/install/
I use gitlab-ee_12.10.14-ee.0_amd64.deb
 OS: Ubuntu 20.04
 Constraint by libc version, I can’t use upper than version 12.

Install steps by step as official web’s said.
https://about.gitlab.com/install/#ubuntu


Step 2. Configurate Gitlab
1.
$ gitlab-ctl reconfigure

2.
Open /etc/gitlab/gitlab.rb and modify external_url
 external_url ’http://localhost:8088’


Step 3. Initialize your project
You can import from github or build a new one by yourself.
https://docs.gitlab.com/ee/user/project/index.html#new-project


Step 4. Configure runner
https://docs.gitlab.com/ee/ci/runners/

Go to Settings > CI/CD and expand the Runners section.
Note the URL and token.
Register the runner

– Modify gitlab runner
 /etc/gitlab-runner/config.toml

 concurrent = 1
 check_interval = 0

 [[runners]]
 name = “ci”
 url = “http://*** ”  <– write the URL in Runners section
 token = “????” <– write the token in Runners section
 executor = “shell” <– I want to use shell to my CI/CD
 builds_dir = “/mdata/builds”
 output_limit = 8192 <– allowed build time

$ gitlab-runner restart


Step 5. Set up CI/CD pipeline
Write your pipeline in
.gitlab-ci.yml
https://docs.gitlab.com/ee/ci/yaml/README.html#introduction


Step 6. Customize my test script.
I want to use “shell” to execute all tests automatic.
/*to be contibued*/



Note commands of runner:
– for debug
 sudo gitlab-runner –debug run
– reconfigure
 sudo gitlab-runner run –config /etc/gitlab-runner/config.toml
– login as gitlab-runner
 sudo su gitlab-runner && cd ~