gitlab添加CI

 

坑1:

下载速度很慢

解决方案: https://mirrors.tuna.tsinghua.edu.cn/help/gitlab-ci-multi-runner/

配置

提示:GitLab Runner >= 9.0 can be used ONLY with GitLab CE/EE >= 9.0

坑2:

先要安装符合gitlab版本的runner的

查看gitlab版本

http://git.azure.gagogroup.cn/help

GitLab Community Edition 8.13.6 69cda01

sudo yum remove gitlab-ci-multi-runner

sudo yum install gitlab-ci-multi-runner-1.11.1

坑3:

Please enter the executor: shell, docker, docker-ssh, ssh?

shell建议部署使用

docker建议仅仅代码测试使用

坑4:

测试失败显示:gitlab ci webpack EACCES: permission denied

chown webpack:root -R /home/www/

 

坑5:

service使用私有docker容器

https://docs.gitlab.com/ce/ci/docker/using_docker_images.html#define-an-image-from-a-private-docker-registry

 

坑6:

connect:

image: dockerstore.gagogroup.cn:5000/postgis:latest

script:

- export PGPASSWORD="$POSTGRES_PASSWORD"

- psql -h 'dockerstore.gagogroup.cn-postgis' -U "$POSTGRES_USER" -d "$POSTGRES_DB" -a -f './sql/test/test_create.sql'

- psql -h 'dockerstore.gagogroup.cn-postgis' -U "$POSTGRES_USER" -d "$POSTGRES_DB" -a -f './sql/test/test_insert.sql'

 

坑7:

sudo: no tty present and no askpass program specified

要赋予gitlab-runner用户root权限的同时加NOPASSWD

$ sudo usermod -a -G sudo gitlab-runner

sudo visudo

gitlab-runner ALL=(ALL) NOPASSWD: ALL

http://stackoverflow.com/questions/19383887/how-to-use-sudo-in-build-script-for-gitlab-ci

 

坑8:

https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/commands/README.md#gitlab-runner-unregister

gitlab-runner unregister --name test-runner

 

坑9:

centos在yum update之后之前yum install的软件会升到最新版本.

posted @ 2017-04-14 21:39  阿愿的笔记本  阅读(1492)  评论(0编辑  收藏  举报