GitLab¶
GitLab¶
Docker 安装 GitLab¶
nerdctl create network compose
nerdctl compose up -d
nerdctl exec -it gitlab cat /etc/gitlab/initial_root_password
Helm 安装 GitLab¶
# helm repo add gitlab http://charts.gitlab.io/
helm repo add gitlab-jh https://charts.gitlab.cn
helm repo update
# helm upgrade gitlab gitlab/gitlab --install --namespace gitlab --create-namespace --values gitlab.yaml --version 6.3.2
helm upgrade gitlab gitlab-jh/gitlab --install --namespace gitlab --create-namespace --values gitlab.yaml --version 6.3.2
kubectl get secret -n gitlab gitlab-gitlab-initial-root-password -ojsonpath='{.data.password}' | base64 --decode ; echo
GitLab CI¶
GitLab Runner¶
Shell 执行器¶
curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
chmod +x /usr/local/bin/gitlab-runner
# 直接使用 root 用户运行 runner 但是工作目录依然在原先的用户主目录下
mkdir -p /home/gitlab-runner
gitlab-runner install --user=root --working-directory=/home/gitlab-runner
gitlab-runner start
SSH 执行器¶
-
生成 SSH 秘钥
-
启动容器
-
注册
-
解决
error: ssh: handshake failed: knownhosts: key is unknown
Kubernetes 执行器¶
helm repo add gitlab http://charts.gitlab.io/
helm repo update
helm upgrade gitlab-runner gitlab/gitlab-runner --install --namespace gitlab --create-namespace --values gitlab-runner.yaml --version 0.43.1
GitLab Agent¶
Helm 安装 GitLab Agent¶
helm repo add gitlab https://charts.gitlab.io
helm repo update
helm upgrade gitlab-agent gitlab/gitlab-agent \
--install \
--namespace gitlab \
--create-namespace \
--set image.tag=v15.2.0 \
--set config.token=<TOKEN> \
--set config.kasAddress=ws://kas.dev.icefery.xyz
GitLab MinIO¶
查看 Access Key 和 Secrey Key¶
kubectl get -n gitlab secrets gitlab-minio-secret -ojsonpath='{.data.accesskey}' | base64 --decode
kubectl get -n gitlab secrets gitlab-minio-secret -ojsonpath='{.data.secretkey}' | base64 --decode