- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要创建在 Amazon EC2 上的 Windows VM 下运行的 Jenkins 代理云。
我对此的看法是简单的场景:
我有几个预配置的 AMI,每个虚拟机都有与我的项目之一匹配的特定环境。我几乎没有需要经常构建的项目来保持虚拟机运行。但有些构建将每周运行,另一些则每月运行...Jenkins 应该能够在项目构建时自动启动 VM,并在构建完成时终止 VM。我有几个BCB项目和许多.NET项目,Windows作为从VM操作系统是绝对必要的。
准备安装和配置 Jenkins 从属的预配置 AMI 不是问题。但我不知道如何从主服务器管理此类从属虚拟机(运行/终止它们)
我找到了可用于运行和终止虚拟机的 Amazon EC2 插件。但它也尝试在那里安装和运行从属设备。不幸的是,Windows 从站尚不支持。有没有办法使用预配置的 AMI 或让 Amazon EC2 插件在 Windows VM 上安装代理?
我也尝试使用 TeamCity - 它可以运行预配置的 Windows AMI 并在那里构建项目(正是我的场景)。但我需要太多虚拟机,而我的老板还没有准备好支付许可证费用(3 个免费许可证不够)
是否可以在我的场景中使用 Jenkins?还有其他选择吗?
最佳答案
boto.ec2 可以完美地用于随时随地启动/停止/终止实例。
我为此使用了一个脚本。这是我可以分享的一部分。我无法分享某些部分。感谢您的理解。
#!/usr/bin/python
import boto.ec2
import sys
import time
# specify AWS keys
auth = {"aws_access_key_id": "YOUR_KEY", "aws_secret_access_key": "YOUR_SECRET_KEY"}
def main():
# read arguments from the command line and
# check whether at least two elements were entered
if len(sys.argv) < 2:
print "Usage: python aws.py {start|stop}\n"
sys.exit(0)
else:
action = sys.argv[1]
if action == "start":
startInstance()
elif action == "stop":
stopInstance()
else:
print "Usage: python aws.py {start|stop}\n"
def startInstance():
print "Starting the instance..."
# change "eu-west-1" region if different
try:
ec2 = boto.ec2.connect_to_region("eu-west-1", **auth)
except Exception, e1:
error1 = "Error1: %s" % str(e1)
print(error1)
sys.exit(0)
# change instance ID appropriately
try:
instances = ec2.start_instances(instance_ids="ID_INSTANCE TO START")
instances[0].update()
while instances[0].state != "running":
print instances[0].state
time.sleep(5)
instances[0].update()
#this part manage the association of Elastic IP
ec2.associate_address("ID_INSTANCE","ELASTIC IP")
except Exception, e2:
error2 = "Error2: %s" % str(e2)
print(error2)
sys.exit(0)
def stopInstance():
print "Stopping the instance..."
try:
ec2 = boto.ec2.connect_to_region("eu-west-1", **auth)
except Exception, e1:
error1 = "Error1: %s" % str(e1)
print(error1)
sys.exit(0)
try:
ec2.stop_instances(instance_ids="INSTANCE_ID")
instances[0].update()
while instances[0].state != "stopped":
print instances[0], instances[0].state
time.sleep(5)
instance.update()
print "Instance stopped : "
except Exception, e2:
error2 = "Error2: %s" % str(e2)
print(error2)
sys.exit(0)
if __name__ == '__main__':
main()
关于.net - Jenkins Amazon EC2 代理云 - Windows 从属,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12692071/
我正在 Jenkins 中配置从 Linux 节点。这里的多个标签的正确语法(分隔符和转义)是什么? 最佳答案 您应该使用 whitespaces 分隔标签。如果标签包含空格,您应该引用它(单引号和双
我已经设置了 master(192.168.1.10) 和 slave(192.168.1.11) postgresql。登录slave postgresql报错: postgres@sonia-Sy
我支持由小型企业托管的应用程序,基于 Web 的 ROR 应用程序在后端使用 pgsql 数据库。 Postgres 设置为复制到异地备用服务器,据我所知它工作正常,当我查询远程服务器时它显示它正在恢
这个方法是我写的(和其他帖子差不多) public void update(string fileName, string sheetName) { string connString = c
我已经为 MySQL 服务器设置了复制。我可以使用复制用户/密码从从机连接到主服务器。我已经运行了从属 SQL 线程,但是从属 I/O线程未运行,使用“显示从属状态”检查时从属 I/O 状态为空。可能
在使用Jenkins Docker插件时,可能由于错误而导致无法启动群集。我没有注意,目前有数千个脱机节点无法启动。 底线-是否可以批量删除Jenkin中的节点(从属),清理所有脱机节点甚至删除所有节
我正在尝试在一个旧项目中引入持续集成,我们遇到了非常具体的情况 - 可以将 CI 服务器只放在我们在 CentOS 上运行的测试服务器上。服务器有很多未使用的 RAM 和 CPU 功能。 但是,我们需
我最近更改了我的 jenkins 机器使用的其中一个从属设备的 DNS cname 记录。进行更改后,我更新了节点中的信息,使其指向新名称。从那时起,jenkins slave 无法启动并出现以下错误
我需要创建在 Amazon EC2 上的 Windows VM 下运行的 Jenkins 代理云。 我对此的看法是简单的场景: 我有几个预配置的 AMI,每个虚拟机都有与我的项目之一匹配的特定环境。我
使用 Jenkins EC2 插件,我无法让我的 Jenkins 主服务器通过 SSH 连接到我的 Jenkins 从服务器。从站启动并正确配置,但是: INFO: Connecting to 10.
奇怪的问题,我在工作区中有两个项目: 项目A 项目B 在 projectA 的 pom.xml 中我添加了: groupid projectB version 当我构建应用程序并部署到 tomca
在我的 Jenkinsfile 中出现错误后,从属代理 pod 似乎总是很快就会死亡并消失。有没有办法在我身处其中时执行它并使其保持事件状态?我使用 Helm 在 Kubernetes 上运行 Jen
我是一名优秀的程序员,十分优秀!