DEV Community

Cover image for Running my first Gitlab CI/CD pipeline
cosckoya
cosckoya

Posted on

5 3

Running my first Gitlab CI/CD pipeline

I was testing some Gitlab functionalities on my last jobs, but I've never played it by myself so, I decided to migrate my personal wiki/toolbox into Gitlab pages and see how it goes.

Why Gitlab? Because I am feeling more comfortable with it. Github is a very nice SCM but I wanted to start working with Gitlab and I though that this could be a very nice opportunity to do so.

So, I migrated my repository from Github to Gitlab, just pushing all the files to an empty Gitlab repository project. That's all.

Also I created a ".gitlab-ci.yaml" file with a few steps to control the deployment:

image: python:3.8-buster

before_script:
  - pip install -r requirements.txt

test:
  stage: test
  script:
  - mkdocs build --strict --verbose --site-dir test
  artifacts:
    paths:
    - test
  except:
  - master

pages:
  stage: deploy
  script:
  - mkdocs build --strict --verbose --site-dir public
  artifacts:
    paths:
    - public
  only:
  - master
Enter fullscreen mode Exit fullscreen mode

Leaving this file in the repository root path, now the project looks like this:

CMD> tree -a -L 1                       
.
├── docs
├── .git
├── .gitignore
├── .gitlab-ci.yml
├── mkdocs.yml
├── README.md
└── requirements.txt

2 directories, 5 files
Enter fullscreen mode Exit fullscreen mode

When I just committed my changes into the repository, everything starts to run and the CI finally just deployed my project into Gitlab Pages. Here is the result: Cosckoya Gitlab pages.

Amazing.

I really want to test some more Gitlab CI/CD (Terraform, Docker, Helm) and integrations (Hangouts, Slack) with this new toy of mine.

Enjoy!

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay