如何在合并请求和合并后运行 GitLab CI?
两个分支,dev 和 master。两个工作,测试和部署。
在从任何分支到 dev 分支的合并请求时,CI 将触发。但我现在只想运行测试作业。当合并请求被合并时,它将继续执行部署作业。原因是,虽然所有的测试都会通过,但我们仍然无法继续部署,因为在 Code Review 中,验证者可能会提出一些开发人员需要解决的评论。只有在处理这些评论之后,如果单元测试成功,才会允许合并。合并请求合并后,才允许部署。dev 分支将部署到 dev/test,master 将部署到 staging。Prod 将手动部署。
嗨,我有很多需要lambda:UpdateFunctionCode许可的 lambda 函数。在资源字段中输入所有函数的ARN太麻烦了。我的所有函数都有一个前缀,当我尝试prefix*在资源字段中使用时,它不允许我使用。
这是我尝试过但没有奏效的方法。
"arn:aws:lambda:ap-southeast-1:xxxxxxxx:function:prefix*"
Run Code Online (Sandbox Code Playgroud)
有没有办法为此使用通配符?
编辑:添加了一个假帐号。
我们的ci工作流程是这样
现在,我注意到codebuild将在推送时触发。我如何才能使其在合并请求时触发?
我目前正在使用 codepipeline、codebuild、codedeploy 和 codecommit 创建管道。当我将 codebuild 构建工件上传到 s3 时遇到问题,因为它不遵循我在 buildspec.yml 中设置的工件名称:
artifacts:
files:
- '**/build/*'
name: build-$(date +%Y-%m-%d)
Run Code Online (Sandbox Code Playgroud)
相反,它会随机创建一个构建名称。在我的 codebuild 设置中,我已经启用了语义版本控制,但它似乎被 codepipeline 忽略了,因为我可以在日志中看到,如果我运行 codepipeline 或仅运行 codebuild,则生成构建工件时存在差异。
这是仅在代码构建的日志中显示的内容:
[Container] 2019/08/08 09:28:07 Assembling file list
[Container] 2019/08/08 09:28:07 Expanding **/build/*
[Container] 2019/08/08 09:28:08 Found 144 file(s)
[Container] 2019/08/08 09:28:08 Updating artifact name as build-2019-08-08
Run Code Online (Sandbox Code Playgroud)
这是 codepipeline 日志中显示的内容:
[Container] 2019/08/08 09:19:50 Assembling file list
[Container] 2019/08/08 09:19:50 Expanding **/build/*
[Container] 2019/08/08 09:19:50 Found 144 file(s)
[Container] 2019/08/08 09:19:50 Phase complete: UPLOAD_ARTIFACTS State: SUCCEEDED …Run Code Online (Sandbox Code Playgroud) 我目前正在使用 webdriverio 为我当前的项目编写自动化测试。问题是我目前工作的公司对安全性非常严格,因此将凭据放在规范文件中是一个很大的问题。我们正在工作的这个项目是一个内部工具,身份验证使用员工的 gmail 帐户,这也是公司使用的所有服务中使用的身份验证。有人可以建议其他方法如何安全地存储我的规范文件可以访问的凭据。谢谢。
为什么jenkins不执行我的jenkinsfile?我构建的控制台输出是这样的:
20:06:19 Started by GitLab push by
20:06:19 Building in workspace /var/jenkins_home/workspace/repo
20:06:19 [WS-CLEANUP] Deleting project workspace...
20:06:19 [WS-CLEANUP] Done
20:06:19 Cloning the remote Git repository
20:06:19 Cloning repository
20:06:19 > git init /var/jenkins_home/workspace/ # timeout=10
20:06:19 Fetching upstream changes from https://gitlab.com/
20:06:19 > git --version # timeout=10
20:06:19 using GIT_ASKPASS to set credentials
20:06:19 > git fetch --tags --progress https://gitlab.com/t+refs/heads/*:refs/remotes/origin/*
20:06:21 > git config remote.origin.url https://gitlab.com/ # timeout=10
20:06:21 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
20:06:21 > …Run Code Online (Sandbox Code Playgroud) 所以这是我从某个地方获得的数组,我想得到包含"text"=>"Assets"的对象的索引.我怎么能在Ruby中做到这一点?
例
[{
"class" => "android.support.v7.widget.AppCompatTextView",
"tag" => nil,
"description" => "android.support.v7.widget.AppCompatTextView{b777d8c V.ED..... ........ 0,39-355,168 #7f0e007f app:id/textview_sectiontitle}",
"id" => "textview_sectiontitle",
"text" => "Assets",
"visible" => true,
"rect" => {
"height" => 129,
"width" => 355,
"y" => 2088,
"x" => 80,
"center_x" => 257,
"center_y" => 2152
},
"enabled" => true,
"contentDescription" => nil
},
{
"class" => "android.support.v7.widget.AppCompatImageButton",
"tag" => nil,
"description" => "android.support.v7.widget.AppCompatImageButton{ae57704 VFED..C.. ........ 1056,0-1280,208 #7f0e0109 app:id/imagebutton_amount}",
"id" => "imagebutton_amount",
"visible" => true,
"rect" => {
"height" …Run Code Online (Sandbox Code Playgroud) 所以我们目前在最近的项目中使用无服务器,我们的客户端为我们提供了aws iam用户,因为我们将部署到他们的aws资源中.问题是他们不会向用户提供create s3策略.s3存储桶的创建将由他们手动完成.那么在serverless.yml中我可以添加他们创建的s3存储桶并且无服务器将其用作部署存储桶而不是创建新存储桶?
我只想问一下serverless.yml中vpc部分中值的正确格式是什么,尤其是securityGroupIds字段和subnetIds字段。如果我在aws控制台中转到lambda服务,这会引起我的困惑,当我们在其中添加vpc设置时,securityGroupIds的字符串格式如下所示:
xx-xxxxxxxx(xx_xx_xxx_xxxxxx_xxxxxx)|xx_xx_xxx_xxxxx_xxxxxx
而如果我在AWS控制台中转到vpc服务并单击安全组,则安全组ID的字符串格式为:
xx-xxxxxxxx | xx_xx_xxx_xxxxxx_xxxxxx
对于子网ID,lambda页面中的一个具有如下格式:
subnet-xxxxxxxx(xx.xxx.xx.0/xx)|ap-southeast-1a subnet-public-1a
而在vpc页面中,格式为:
subnet-xxxxxxxx
我的问题是我应该在serverless.yml中输入哪种格式。在lambda页面上还是在vpc页面上?
我有一个值为 的变量x.x.x,我需要一个函数,该函数首先将最右边的值增加到10,当它达到 时11,增加最左边的值。相同的规则适用于所有值;当它们到达 时11,它们将增加最左边的值。我需要这个来在 fastlane 中自动生成版本号。
ruby ×2
amazon-iam ×1
aws-lambda ×1
gitlab-ci ×1
jenkins ×1
security ×1
serverless ×1
webdriver-io ×1