Gitlab-Google计算引擎持续交付 [英] Gitlab - Google compute engine Continuous delivery

查看:101
本文介绍了Gitlab-Google计算引擎持续交付的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要做的是启用从GitLab到Google Cloude上的计算引擎的持续交付。我在那里运行Ubuntu 16.04 TSL。我确实安装了运行项目所需的所有组件,例如:Swift,蒸气,nginx。
我也设法安装了Gitlab运行程序,并创建了一个运行程序,可以从我的gitlab存储库中访问它。每次我按下主踏板时,触发器就会触发。发生故障是由于以下原因:

What I am trying to do is to enable Continuous delivery from GitLab to my compute engine on Google Cloude. I have Ubuntu 16.04 TSL running over there. I did install all components needed to run my project like: Swift, vapor, nginx. I have manage to install Gitlab runner as well and created a runner whcihc is accessible from my gitlab repo. Everytime I do push on master the runner triggers. What happen is a failure due to:

无法创建'/ home / gitlab-runner / builds / 2bbbbbd / 0 / Server的前导目录/Packages/vapor.git':权限被拒绝

如果我将权限更改为 chmod -R 777 它将在 running 上挂起,以进行gitlab管道上可见的 build 阶段。

If I change the permissions to chmod -R 777 It will hange on running for build stage visible on gitlab pipeline.

我做了类似的事情:
sudo chown -R gitlab-runner:gitlab-runner / home / gitlab-runner / builds
sudo chown -R gitlab-runner:gitlab-runner / home / gitlab-runner / cache
,但这还不是' t帮助,错误是相同的权限被拒绝

I did something like: sudo chown -R gitlab-runner:gitlab-runner /home/gitlab-runner/builds sudo chown -R gitlab-runner:gitlab-runner /home/gitlab-runner/cache but this haven't help, the error is same Permission denied

在下面有我的 .gitlab- ci.yml

before_script:
  - swift --version

stages:
  - build
  - deploy

job_build:
  stage: build
  before_script:
  - vapor clean
  script:
  - vapor build --release
  only:
  - master

job_run_app:
  stage: deploy
  script:
    - echo "Deploy a  API"
    - vapor run --name=App --env=production
  environment:
    name: production

job_run_frontend:
  stage: deploy
  script:
    - echo "Deploy a  Frontend"
    - vapor run --name=Frontend --env=production
  environment:
    name: production

但这还没有进入下一阶段。部署。我已经等了14小时以上,但没有结果。
还有...我还有几个问题:

But that haven't pass to next stage eg. deploy. I had waited more then 14h for that but with out result. And... I have few more questions:


  1. Gitlab运行程序在位置 / home下创建构建/ gitlab-runner / builds / 在此位置,每个新作业都有自己的文件夹。例如 / home / gitlab-runner / builds / 2bbbbbd / 在其中,这是我的项目,命令已执行。那么当第一个运行并且我确实部署新版本时会发生什么?端口被第一个实例阻塞,依此类推?

  2. 如果我想启用 supervisor ,该如何处理?每次我部署的文件夹都不同吗?

  3. 有人可以解释或向我展示或向我介绍如何在没有docker的情况下进行连续部署吗?

  1. Gitlab runner creates builds under location /home/gitlab-runner/builds/ in this location every new job have own folder. for eg. /home/gitlab-runner/builds/2bbbbbd/ in which is my project and the commands are executed. So what happens when the first one is running and I do deploy new version? the ports are blocked by the first instance and so on?
  2. If I want to enable supervisor how do I do that with this when every time I deploy folder is different?
  3. Can anyone explain or show me or point me to tutorial how do Continuous deployment with out docker?


推荐答案

如何使用GitLab运行器启动服务

感谢长时间的深入搜索,我终于找到了一个答案!完整的文章可以在上面找到。

Thanks to long deep search I finally found an answer! The full article can be found above.

简而言之,GitLab CI文档建议使用dpl进行部署。 Gitlab运行器运行测试和过程应结束。设计运行器是为了在完成每次构建后杀死所有创建的进程。 GitLab运行程序无法在目录外执行操作。

Briefly GitLab CI documentation recommends using dpl for deployment. Gitlab runner run test and process should end. The runner is designed to kill all created processes after finishing each build. The GitLab runner is unable to perform operations outside the catalogue.

这篇关于Gitlab-Google计算引擎持续交付的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆