## 1.0 Export ENV
export GITLAB_HOME=<path> // persistent storage for gitlab container
## 1.1 Create following docker compose file (adjust ports if necessary)
services:
gitlab:
image: gitlab/gitlab-ce:latest
container_name: gitlab
restart: always
hostname: 'localhost'
ports:
- '80:80'
- '443:443'
- '1022:22'
volumes:
- '$GITLAB_HOME/config:/etc/gitlab'
- '$GITLAB_HOME/logs:/var/log/gitlab'
- '$GITLAB_HOME/data:/var/opt/gitlab'
shm_size: '256m'
## 1.2 Start docker container
docker compose up -d // from folder where compose file resides
## 1.3 Reset root password using ssh
docker exec -it gitlab /bin/bash // open shell on gitlab container
gitlab-rake "gitlab:password:reset" // might take a minute to load
## 1.4 Register new user in gitlab
<use ui>
https://docs.gitlab.com/ee/tutorials/create_register_first_runner/
## 2.1 Install gitlab runner (https://docs.gitlab.com/runner/install/linux-manually.html)
skip dedicated user, instead use:
sudo gitlab-runner install --user=dev --working-directory=/home/dev/projects/gitops/gitlab-runner
## 2.2 Create GitLab project
<use ui>
## 2.3 Create .gitlab-ci.yml
stages:
- build
- test
job_build:
stage: build
script:
- echo "Building the project"
job_test:
stage: test
script:
- echo "Running tests"
## 2.4 Create and register runner
<https://docs.gitlab.com/ee/tutorials/create_register_first_runner/#create-and-register-a-project-runner>