使用gitlabRunner在Windows EC2上开始构建 [英] Start build on a windows ec2 with gitlab runner

查看:86
本文介绍了使用gitlabRunner在Windows EC2上开始构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

gitlab CI的新手.我有一个自定义的Windows AMI(带有必需的预安装软件),我想在其中运行构建.

New to gitlab CI. I have a custom windows ami (with required pre-installed software) where I would like to run the build.

我的一个选择是保持该实例始终为ON并在其上安装运行程序,但这似乎是对计算的浪费(我已经尝试过此设置).

One of my options is to keep this instance always ON and install the runner on it, but that seems like a waste of compute (I have already tried this set up).

我可以从gitlab CI启动实例吗?我意识到跑步者仍然需要在某个地方运行,可能是在较低层的机器上.我提到了gitlab上提供的AWS自动缩放文档,但它着重介绍了如何使用docker自动缩放.我无法使用与自定义映像绑定的docker设置.

Can I start the instance from gitlab CI? I realize that the runner still needs to be running somewhere, probably on a lower tier machine. I referred to the AWS autoscaling doc available on gitlab, but it highlights how to autoscale with docker. I cannot use the docker setup, kind of tied to the custom image.

如何在ec2实例中生成并运行管道?

How can I spawn and run my pipeline in the ec2 instance?

推荐答案

Gitlab不知道跑步者在哪里跑步,他们只会知道跑步者是否连接了,所以不,Gitlab本身将无法启动一个实例.

Gitlab has no knowledge of where the runners are running, they will only know if a runner is connected or not, so no, Gitlab itself would not be able to start up an instance.

但是,您可以做的是专门做一个小实例,点击Gitlab API,以确定有多少未完成的作业以及有多少工作人员可以使用它.如果没有跑步者,但有工作要做,请启动跑步者实例.如果有跑步者但没有工作,请停止实例.

What you can do however is dedicate a small instance to hitting the Gitlab API to determine how many pending jobs there are and how many runners are available to work it. If there are no runners but there are jobs to be worked, start a runner instance. If there are runners but no jobs, stop an instance.

以下是一些方便使用的Gitlab API:

Here are some Gitlab API's that should come in handy:

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