From 74507d6e34d93aa74b238c333abebfdae8994ca5 Mon Sep 17 00:00:00 2001 From: TBS093A Date: Fri, 10 Mar 2023 14:46:42 +0100 Subject: [PATCH] upgrade gitlab config && improve README markdown --- gitlab/README.md | 18 ++++++++++++++---- gitlab/docker-compose.yml | 19 ++++++++++--------- gitlab/down.all.sh | 2 +- gitlab/up.all.sh | 3 --- 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/gitlab/README.md b/gitlab/README.md index b6cebe2..3b7a372 100644 --- a/gitlab/README.md +++ b/gitlab/README.md @@ -1,6 +1,6 @@ -# Gitlab configuration +# Gitlab Configuration -## Gitlab IP or DNS address +## Gitlab IP Or DNS Address edit .env file and define external url IP or DNS, it should solve problems with issue routing, try like that (for example): @@ -14,7 +14,7 @@ instead: GITLAB_IP_OR_DNS="http://0.0.0.0" ``` -## SSH config +## SSH Config Add these lines into ~/.ssh/config file (If you want push / pull from remote you must define machine IP instead 0.0.0.0): @@ -30,4 +30,14 @@ And you can use gitlab like that: ```bash git clone git@gitlab:devops-things/docker_images.git -``` \ No newline at end of file +``` + +## Gitlab Runners Config + +run ```up.runners.sh``` at once (on first run), this script will configure runners for concrete gitlab repo (becouse ```RUNNER_REGISTRATION_TOKEN``` is identity of particular repo) -> remember that ```RUNNER_REGISTRATION_TOKEN``` is defined in ```.env``` file, just change it on your repo token. + +gitlab will remember what runner is already registered, and re-register is useless action in this case. + +## Github importer + +when you want import your github repos, you have to create access-token and paste it on ```project import``` form. In next step you can choose what repo you want import exactl. \ No newline at end of file diff --git a/gitlab/docker-compose.yml b/gitlab/docker-compose.yml index ba31d56..4a5000d 100644 --- a/gitlab/docker-compose.yml +++ b/gitlab/docker-compose.yml @@ -7,9 +7,10 @@ services: container_name: docker-registry restart: always environment: - REGISTRY_HTTP_ADDR: 0.0.0.0:80 + REGISTRY_HTTP_ADDR: 0.0.0.0:5000 ports: - - 80 + - 5000 + - 5000:5000 volumes: - ./volumes/docker-registry:/var/lib/registry @@ -36,7 +37,7 @@ services: # container registry setup - registry_external_url 'http://docker-registry/' + registry_external_url 'http://docker-registry:5000/' ports: - 0.0.0.0:80:80 - 0.0.0.0:443:443 @@ -54,8 +55,8 @@ services: links: - gitlab volumes: - - ./volumes/gitlab-runner/config:/etc/gitlab-runner - - ./volumes/gitlab-runner/projects:/etc/projects + - ./volumes/gitlab-runner-000/config:/etc/gitlab-runner + - ./volumes/gitlab-runner-000/projects:/etc/projects - /var/run/docker.sock:/var/run/docker.sock gitlab-runner-001: @@ -64,8 +65,8 @@ services: links: - gitlab volumes: - - ./volumes/gitlab-runner/config:/etc/gitlab-runner - - ./volumes/gitlab-runner/projects:/etc/projects + - ./volumes/gitlab-runner-001/config:/etc/gitlab-runner + - ./volumes/gitlab-runner-001/projects:/etc/projects - /var/run/docker.sock:/var/run/docker.sock gitlab-runner-002: @@ -74,6 +75,6 @@ services: links: - gitlab volumes: - - ./volumes/gitlab-runner/config:/etc/gitlab-runner - - ./volumes/gitlab-runner/projects:/etc/projects + - ./volumes/gitlab-runner-002/config:/etc/gitlab-runner + - ./volumes/gitlab-runner-002/projects:/etc/projects - /var/run/docker.sock:/var/run/docker.sock \ No newline at end of file diff --git a/gitlab/down.all.sh b/gitlab/down.all.sh index b134ce9..58694d0 100755 --- a/gitlab/down.all.sh +++ b/gitlab/down.all.sh @@ -1 +1 @@ -sudo docker-compose down \ No newline at end of file +docker-compose down \ No newline at end of file diff --git a/gitlab/up.all.sh b/gitlab/up.all.sh index 849832e..61e5214 100755 --- a/gitlab/up.all.sh +++ b/gitlab/up.all.sh @@ -1,6 +1,3 @@ source ./.env docker-compose up -d -sleep 120 -./up.runners.sh -