Giter Site home page Giter Site logo

gitlab-ci-server's Introduction

部署 gitlab-ci 服务

1. 部署前操作

- 域名映射
- nginx配置 反代8880,8443 端口
- 配置docker-compose 参数

2. 生成CI 密钥 (供CI操作,访问远程服务使用)

# 指定密钥存放位置(请切换到源码位置) 
# CI_SSH_PATH 默认: /root/.ssh 
# 最好将 CI_SSH_PATH 写入 ~/.bashrc文件
export CI_SSH_PATH=`pwd`/ssh 
mkdir $CI_SSH_PATH && chmod 700 $CI_SSH_PATH

# 生成ssh key
ssh-keygen -f $CI_SSH_PATH/id_rsa

3. 部署服务

# 运行完毕可访问 https://gitlab.dairoot.cn
docker-compose up

4. 注册 runner

# https://gitlab.dairoot.cn/admin/runners
# 进入 gitlab-runner 容器
docker exec -it gitlab-runner /bin/bash
# 添加一个runner 服务 (注:volumes 必须为主机的绝对路径(非docker))
gitlab-runner register --url http://gitlab \
--docker-volumes $CI_SSH_PATH/id_rsa:/root/.ssh/id_rsa:ro \
--docker-volumes $CI_SSH_PATH/id_rsa.pub:/root/.ssh/id_rsa.pub:ro \
--executor docker --tag-list "test" --docker-image docker:stable

5. runner web 配置

# 取消默认 Auto DevOps
https://gitlab.dairoot.cn/admin/application_settings/ci_cd

# 运行未标记的作业
https://gitlab.dairoot.cn/admin/runners/1

6. 编辑 runner/config.toml

将 volumes = ["/cache"] 更改为 volumes = ["/home/gitlab/build_cache:/cache:rw"]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.