zoukankan      html  css  js  c++  java
  • gitlab-runner-config-in-docker

    gitlab in docker

    • 网上有很多现成的解决方案,本文仅作流程梳理,若不需要,可直接用gitlab官方提供的镜像

    installation

    Dockerfile
    
    FROM registry.api.weibo.com/weibo_rd_algorithmplatform/suanec/centos_7_4_1708:wctr_mpk8r_jdk_yarn_install_without_conf_001
    # FROM registry.api.weibo.com/weibo_rd_algorithmplatform/suanec/centos_7_4_1708:wctr_emr_yarn_weibox_0.0.0.4_001
    
    MAINTAINER suanec <enzhao@staff.weibo.com>
    
    RUN pip install redis
    
    ADD ./localip.sh ./start_HTTPServer.sh /data0/
    
    RUN wget https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.rpm.sh
    
    RUN sh script.rpm.sh
    
    RUN yum -y install gitlab-ci-multi-runner.x86_64
    
    # WORKDIR /data0/control_center/weibox/weibox-docker/flink-check/
    
    # ADD ./py-source /data0/control_center/weibox/weibox-docker/flink-check
    
    # ENTRYPOINT ["/bin/python", "/data0/control_center/weibox/weibox-docker/flink-check/flink-illegal-watchdog.py"]
    

    register

    gitlab-runner register --config '/data0/develop-gitlab-ci/host-py-source/gitlab-config.toml' --url 'http://git.intra.mosaic.com/' --registration-token '8s2cbdazXftXNj-H8M7y' --name 'weiclient-docker-develop-gitlab-ci-bx-core.jpool.mosaic.cn' --tag-list 'python2.7,docker-develop-gitlab-ci' --executor 'shell' --non-interactive
    

    running

    #!/bin/bash
    LOG_DIR=$1
    if [ -z ${LOG_DIR} ]
    then
        export LOG_DIR="/data0/control_center/weibox/weibox_containers"
    fi
    source ./dockertag.sh
    # REALPATH=`realpath .`
    REALPATH="$( cd "$( dirname "$0" )" && pwd )"
    DOCKER_CONTAINER_NAME_PREFIX="develop-base"
    DOCKER_CONTAINER_NAME_PREFIX="${SUANEC_DOCKER_TAG}"
    DOCKER_CONTAINER_NAME_SUFFIX=$(date +-%Y%m%d)
    DOCKER_CONTAINER_NAME=${DOCKER_CONTAINER_NAME_PREFIX}${DOCKER_CONTAINER_NAME_SUFFIX}
    docker kill ${DOCKER_CONTAINER_NAME};docker rm ${DOCKER_CONTAINER_NAME}
    docker run  -d 
    --net="host" 
    --name=${DOCKER_CONTAINER_NAME} 
    --restart=always 
    -v /etc/localtime:/etc/localtime:ro 
    -v ${REALPATH}/py-source:/data0/${DOCKER_CONTAINER_NAME_PREFIX}/host-py-source 
    "${SUANEC_DOCKER_REPO}${SUANEC_DOCKER_NAME}${SUANEC_DOCKER_TAG}" 
    gitlab-runner run -c /data0/${DOCKER_CONTAINER_NAME_PREFIX}/host-py-source/gitlab-config.toml
    

    trouble-shooting

    This job is stuck, because you don't have any active runners that can run this job.
    
    Can run untagged jobs: no and you have a tag ansible for this runner.
    
    1. add project tags for runner
    2. set runner for can run with untag.
    
  • 相关阅读:
    Centos7上安装docker
    centos如何查看某一目录下每个目录或文件占用磁盘空间大小
    大学毕设参考文献在什么网站搜索
    Spring MVC使用jstl 标签c:forEach 遍历输出双层嵌套List的数据
    JQuery选择器通过click事件获取当前点击对象的id,name,value属性
    利用ajax和servlet实现前后端数据交互(json)
    Java软件工程的弹幕调试原则
    周周总结——时时更新(第4学期,第8周)
    团队软件的NABCD——星遇
    周周总结——时时更新(第4学期,第7周)
  • 原文地址:https://www.cnblogs.com/suanec/p/12452462.html
Copyright © 2011-2022 走看看