aws-codebuild

AWS CodeBuild not generating build folder - NodeJS

杀马特。学长 韩版系。学妹 提交于 2020-07-08 03:45:37
问题 I'm trying to migrate a website from Heroku to AWS and running into trouble with CodeBuild. The source code is on GitHub and I'm using CodePipeline - CodeBuild - Elastic Beanstalk. The Pipeline works fine and it seems like the code is making its way to Elastic Beanstalk. However, I'm stuck at the CodeBuild step. (buildspec.yml is below) The logs seem to run the commands fine, but when I output the build to an S3 bucket, there is no build folder. And that's the problem I'm having with Elastic

Will AWS Codepipeline pass symlinks to Codebuild in artifacts

自古美人都是妖i 提交于 2020-05-29 10:15:08
问题 I have some symlinks in my github repo. When I have a Codebuild project that clones directly from github, symlinks are preserved. I switched so that Codepipeline listens for changes in my dev branch in github, and passes the artifacts to codebuild. Since making this switch, Codebuild can't see the symlinks anymore. Is this by design, or am I perhaps missing something in how my codepipeline is configured? 回答1: Up to now, AWS CodePipeline doesn't support symlinks in source. Refer to Source

Caching the Gradle wrapper in AWS CodeBuild

一个人想着一个人 提交于 2020-04-11 06:04:14
问题 This is what my current buildspec looks like: phases: build: commands: - ./gradlew soakTest -s cache: paths: - '/root/.gradle/caches/**/*' - '.gradle/**/*' But when this buildspec runs in CodeBuild, it prints messages that it is downloading gradle 4.7. It appears that other things are being cached correctly - I don't see log messages about downloading jar dependencies, for example. What should the buildspec cache specifications look like, in order to make sure the Gradle version that the

AWS CodeBuild local cache failing to actually cache?

五迷三道 提交于 2020-04-09 15:54:55
问题 I've been trying to get AWS CodeBuild's local cache to work and for the life of me I can't get even the most basic cache to work. My ultimate goal is to cache Gradle artifacts, as discussed here. But because I couldn't get that to work, I tried an even simpler test, where I try to cache the directory /root/foo with a file counter.txt that I increment each build. My expectation is that if I run subsequent builds within a few minutes of each other, I would see "2", "3", etc in the logs. But the

AWS CodeBuild local cache failing to actually cache?

自作多情 提交于 2020-04-09 15:50:03
问题 I've been trying to get AWS CodeBuild's local cache to work and for the life of me I can't get even the most basic cache to work. My ultimate goal is to cache Gradle artifacts, as discussed here. But because I couldn't get that to work, I tried an even simpler test, where I try to cache the directory /root/foo with a file counter.txt that I increment each build. My expectation is that if I run subsequent builds within a few minutes of each other, I would see "2", "3", etc in the logs. But the

CodePipeline deployment to Beanstalk fails despite IAM properly set up

六月ゝ 毕业季﹏ 提交于 2020-03-24 03:32:23
问题 Context This was a CodeStar project initially, and then it grew into something bigger. We reused the Beanstalk application to create the stage and prod environments and kept the initially-created dev environment as-is. We updated the CodePipeline to deploy to our new environments using "Elastic Beanstalk" as the Provider. (While CodeStar had setup a deployment using CloudFormation for the environment it automatically provisioned in the Beanstalk application.) The problem The deployment fails

AWS CodeBuild VPC_CLIENT_ERROR: Unexpected EC2 error: UnauthorizedOperation

不羁的心 提交于 2020-03-23 07:33:52
问题 I created CodeBuild project in a custom VPC and in private subnet. Private subnet has internet access, also AWS console confirms that internet connection is for this code build project. I keep getting VPC_CLIENT_ERROR: Unexpected EC2 error: UnauthorizedOperation error in "Provisioning" phase of the build. There must be something missing in my service role policy but cant figure out what. Here is CodeBuild project (terraform): resource "aws_codebuild_project" "frontend" { name = "frontend"

AWS CodeBuild - How to skip a build

懵懂的女人 提交于 2020-03-19 07:53:10
问题 My build is triggered on every push to the repo and on every pull request. So CODEBUILD_SOURCE_VERSION looks like "pr/8" or "4570d2e7158cfef687af8da31d1ffec7b02e5ca3". I only want the build to execute for pr branches and pushes to master. What is the best way to achieve this? I don't want to use CodeDeploy as I am just deploying lambdas. I could write a bash function that checks CODEBUILD_SOURCE_VERSION on the install phase and does an exit 1. But this will create a lot of false positives in

get GitHub git branch for AWS CodeBuild

寵の児 提交于 2020-03-17 08:29:21
问题 I'm setup AWS CodeBuild to build automatically from GitHub. Other CI services provide an environment variable for the branch, but I can't find one for AWS CodeBuild. There is a CODEBUILD_SOURCE_VERSION that is set to either pr/7 where 7 is the pull request number or the git commit sha. Given the commit sha, I've been trying to get the branch name, but no luck so far. git branch --contains <commitsha> doesn't work because it is a detached head. How do I get the git branch for the commit from

Cannot run `source` in AWS Codebuild

爷,独闯天下 提交于 2020-02-23 09:06:16
问题 I am using AWS CodeBuild along with Terraform for automated deployment of a Lambda based service. I have a very simple buildscript.yml that accomplishes the following: Get dependencies Run Tests Get AWS credentials and save to file (detailed below) Source the creds file Run Terraform The step "source the creds file" is where I am having my difficulty. I have a simply bash one-liner that grabs the AWS container creds off of curl 169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI and then