what's this
install gitlab/gitlab runner in linux
install gitlab
gitlab home dir
shell
export GITLAB_HOME=/srv/gitlabrun gitlab container
shell
docker run --detach \
--hostname gitlab \
--publish 8003:443 --publish 8000:80 --publish 8002:22 \
--name gitlab \
--restart always \
--volume $GITLAB_HOME/config:/etc/gitlab \
--volume $GITLAB_HOME/logs:/var/log/gitlab \
--volume $GITLAB_HOME/data:/var/opt/gitlab \
--shm-size 256m \
gitlab/gitlab-ce:latestlogin gitlab
shell
docker ps --all | grep gitlab
cat $GITLAB_HOME/config/initial_root_passwordwait gitlab up and then open: http://localhost:8000 root/$password
add ssh pub key
open: http://localhost:8000/-/profile/keys and then attach your pub key
change ssh url
- external url
shell
nano $GITLAB_HOME/config/gitlab.rbrb
external_url 'http://10.60.2.43'
gitlab_rails['gitlab_ssh_host'] = '10.60.2.43'
gitlab_rails['gitlab_shell_ssh_port'] = 8002- restart
shell
docker exec gitlab gitlab-ctl reconfigure
docker exec gitlab gitlab-ctl restart
docker restart gitlabchange http url
menu->admin->settings->general->Visibility and access controls->Custom Git clone URL for HTTP(S)
install gitlab runner
apt install gitlab runner
run container
shell
mkdir -p /home/user/gitlab-runner/config
mkdir -p /home/user/gitlab-runner/data
chmod 777 -R /home/user/gitlab-runner
docker run -id --name gitlab-runner --restart always \
-m 2g \
-v /home/user/gitlab-runner/config:/root/config \
-v /home/user/gitlab-runner/data:/root/data \
ubuntu:latestsetup gitlab-runner
shell
docker exec -it gitlab-runner /bin/bash
apt update && apt upgrade -y
apt install -y curl
curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | bash
apt install gitlab-runner -y
gitlab-runner start
gitlab-runner status
ln -s /etc/gitlab-runner/config.toml /root/config/config.tomlregist runner
get ci/cd url and token
open: http://localhost:8000/project/-/settings/ci_cd get then runner: url and token
config in runner
shell
gitlab-runner registerEnter an executor: shell