docker 部署的 gitlab/gitlab-ce:14.8.1ce.0 、gitlab/gitlab-runner:ubuntu-v14.8.0 ,docker-compose.yml 如下
version: '2' services: gitlab: image: 'gitlab/gitlab-ce:14.8.1-ce.0' container_name: "gitlab" restart: unless-stopped hostname: 'docker-gitlab-01' environment: TZ: 'Asia/Shanghai' # 这里的配置其实就是 /etc/gitlab/gitlab.rb 中的配置,按自己的实际需求增减 GITLAB_OMNIBUS_CONFIG: | external_url 'xxx' gitlab_rails['time_zone'] = 'Asia/Shanghai' prometheus['enable'] = false gitlab_rails['gitlab_shell_ssh_port'] = xxx nginx['listen_port'] = 80 nginx['listen_https'] = false ports: - 'xxx:80' - 'xxx:22' volumes: - /opt/gitlab/config:/etc/gitlab - /opt/gitlab/data:/var/opt/gitlab - /opt/gitlab/logs:/var/log/gitlab networks: - gitlab gitlab-runner: image: gitlab/gitlab-runner:ubuntu-v14.8.0 container_name: "gitlab-runner" restart: unless-stopped depends_on: - gitlab volumes: - ./opt/gitlab-runner:/etc/gitlab-runner - /var/run/docker.sock:/var/run/docker.sock - ./gitlab-runner:/home/gitlab-runner networks: - gitlab networks: gitlab:
目录挂载网上抄的,有点乱。gitlab-runner 为 docker 模式,gitlab-ci.yml 如下:
stages: - build build: # image: electronuserland/builder:14-wine-01.22 image: node:16.14.0-alpine3.14 stage: build script: - node -v - npm -v - yarn - yarn electron:build artifacts: expire_in: 30 days paths: - ./dist_electron/ only: - release tags: - default
现在在执行 yarn
,进入 [4/4] Building fresh packages...
后,就会弹出如下失败日志:
[4/4] Building fresh packages... error /builds/xxxxxx/node_modules/electron: Command failed. Exit code: 1 Command: node install.js Arguments: Directory: /builds/xxxxxxxxxx/node_modules/electron Output: RequestError: socket hang up at ClientRequest.<anonymous> (/builds/xxxxxxx/node_modules/got/source/request-as-event-emitter.js:178:14) at Object.onceWrapper (node:events:640:26) at ClientRequest.emit (node:events:532:35) at ClientRequest.origin.emit (/builds/xxxxxxxxx/node_modules/@szmarczak/http-timer/source/index.js:37:11) at TLSSocket.socketOnEnd (node:_http_client:466:9) at TLSSocket.emit (node:events:532:35) at endReadableNT (node:internal/streams/readable:1346:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. ERROR: Job failed: exit code 1
项目使用@vue/[email protected]
、[email protected]
、[email protected]
构建 尝试在 gitlab-runner 的 docker 中和服务器上直接执行都没有失败,求大佬们看看可以怎么排查问题。