einaregilsson / beanstalk-deploy Goto Github PK
View Code? Open in Web Editor NEWGitHub action (and command line script) to deploy apps to Elastic Beanstalk
License: MIT License
GitHub action (and command line script) to deploy apps to Elastic Beanstalk
License: MIT License
See: https://github.com/jadekler/php-aws/runs/707781910
Uploading file to bucket elasticbeanstalk-af-south-1-597857118726
##[error]Deployment failed: Error: Status: 400. Message:
Any idea what gives?
I think it'd be useful to know if we created a new application version or if this action used a version that already existed.
In my case, I have a deployment pipeline that also increments the version. It'd be useful to use the same pipeline to redeploy old versions, but not increment the version if this action didn't deploy any new artifacts.
Sometimes when we deploy, the environment isn't ready yet, because a previous deploy is also running.
It would be awesome with something similar to wait_for_deployment
, but where it waits before deploying too.
How can I deploy the Asp.net Core Web API project on Bean Stalk? Does this action works for me?
Is there any other alternative or way to deploy Asp.net core API project using GitHub Action on AWS BeanStalk
You guys don't mind if I implement this?
Faced with a situation when I'm migrating the project to GithubActions, and our s3 bucket where we upload zip-files exists already. I want to use the same bucket, but so far, this is not possible
@einaregilsson My concern is how can I deploy my application to different environments on the AWS Beanstalk based on which branch the code is being pushed.
For example - I have two environment prod
and staging
having respective branches master
and staging
. I want to trigger the CI/CD procedure whenever the code is pushed to these branches.
The only thing that needs to be taken care of is that when code pushed to staging branch the application should be deployed to staging environment and if pushed to master branch the build for prod environment should be triggered.
Travis CI has the same thing like below:
deploy:
- provider: elasticbeanstalk
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
region: "ap-south-1"
app: "my-app"
env: "my-app-staging"
bucket_name: "<s3_bucket_name>"
on:
branch: staging
- provider: elasticbeanstalk
access_key_id: $AWS_ACCESS_KEY
secret_access_key: $AWS_SECRET_KEY
region: "ap-south-1"
app: "my-app"
env: "my-app-production"
bucket_name: "<s3_bucket_name>"
on:
branch: master
So, how can I implement the same thing in github action using your action?
Deploy the app fails with this message:
Deployment failed: Error: Deployment failed! Current State: Version: test2, Health: Green, Health Status: Info
Is it a problem with the action or with my EBS?
I've been getting intermittent failed deployments, apparently due to the API requests being throttled. The output is:
Created new application version d00348b in Beanstalk.
Starting deployment of version d00348b to environment ***
Deployment started...
03:05:18 INFO: Environment update is starting.
##[error]Deployment failed: Error: Status: 400. Code: Throttling, Message: Rate exceeded
##[error]Node run failed with exit code 2
Has anybody else come across this issue or have any suggestions on how to rectify it?
Sometimes occurs even when doing the first deployment of the day.
Hi,
Is it possible to use beanstalk-deploy to deploy to Elastic Beanstalk from a docker container in ECR using the repo url and tag?
Thanks,
Esra
Hey again, thanks again for this action.
I ran into a throttling issue when deploying multiple environments on the deploy step. I'm guessing it has to do with deployBeanstalkVersion
being throttled. Was wondering if we could add similar retry-logic as exists in the check environment health call.
Image: https://kceb.d.pr/hFd4dC
I'm trying to use a temporary access token with:
uses: einaregilsson/beanstalk-deploy@v17
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_session_token: ${{ github.event.inputs.session_token }}
But I get:
Error: Deployment failed: Error: Status: 403. Code: InvalidClientTokenId, Message: The security token included in the request is invalid.
I also printed out ${{ github.event.inputs.session_token }}
just to be sure the string is correctly managed by GitHub runner.
With eb cli I can access of course.
Any idea?
Thank you.
Can we get the env of the env that we deployed the file ? or use an argument to get the env something like this:
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: MyApplicationName
environment_name: MyApplication-Environment
version_label: 12345
region: us-west-2
deployment_package: deploy.zip
deployment_env: true
The purpose is to get the CNAM from the Env and do an integration test based on it.
Thank you.
Running this GitHub action always throws an error for me saying that my deployment package does not exist:
I've confirmed that the file exists using ls -l
right before running the deployment step:
My workflow file looks like this:
name: Test & Deploy Packages
on:
push:
branches: [master]
jobs:
changes:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
apiServer: ${{ steps.filter.outputs.apiServer }}
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Check for changes
uses: dorny/[email protected]
id: filter
with:
filters: '.github/filters.yml'
api_server:
runs-on: ubuntu-latest
needs: changes
defaults:
run:
working-directory: packages/api-server
if: ${{ needs.changes.outputs.apiServer == 'true' }}
steps:
- name: Checkout source code
uses: actions/checkout@v1
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: Install dependencies
run: yarn
- name: Tests
run: yarn test
- name: Generate deployment package
run: zip -r api-server-deploy.zip . -x "node_modules/*"
- name: List files
run: ls -l
- name: Deploy to Elastic Beanstalk
uses: einaregilsson/beanstalk-deploy@v10
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: tilt-api-server
environment_name: alpha
version_label: 12345
region: ap-south-1
deployment_package: api-server-deploy.zip
I'm unable to determine the cause for this. Would be great if someone can take a look at it to see if this is a bug with this GitHub action! Thanks.
When I try to deploy my nodejs application to ELB I'm getting this error but i cannot recognize what's my mistake.
My yml file
name: CD Testing ELB
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v1
- name: Setup NodeJS ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Packages
run: npm install --production
- name: Generate Deployment Pacakge
run: zip -r deploy.zip * -x "**node_modules"
- name: Get Timestamp
uses: gerred/actions/current-time@master
id: current-time
- name: Run string replace
uses: frabert/replace-string-action@master
id: format-time
with:
pattern: '[:\.]+'
string: "${{ steps.current-time.outputs.time }}"
replace-with: "-"
flags: "g"
- name: Deploy on Beanstalk
uses: einaregilsson/beanstalk-deploy@v9
with:
aws_access_key: ${{secrets.AWS_ACCESS_KEY}}
aws_secret_key: ${{secrets.AWS_SECRET_KEY}}
application_name: carrinho-digital-web-api
environment_name: CarrinhoDigitalWebApi-env
region: us-east-2
version_label: "carrinho-digital-web-api-${{ steps.format-time.outputs.replaced }}"
deployment_package: deploy.zip
use_existing_version_if_available: true
Hey @einaregilsson
I have an Angular application which needs to be deployed to Elastic Beanstalk using GitHub Actions. I'm following this guideline to deploy by application to ELB.
I'm getting an error:
No filename given, deploying existing version 1
[error]Deployment failed: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be one of type string, Buffer, TypedArray, or DataView. Received type undefined
[error]Node run failed with exit code 2
Here is the screenshot of Actions on GitHub:
I've also opened the question on stack overflow here
Run einaregilsson/beanstalk-deploy@v13
Beanstalk-Deploy: GitHub Action for deploying to Elastic Beanstalk.
https://github.com/einaregilsson/beanstalk-deploy
***** Input parameters were: *****
Application: aws-backend
Environment: Awsbackend-env
Version Label: b2c9b111300de097271b341ec7fa63fbdbff4f16
Version description:
AWS Region: us-east-1
File: data-0.0.1-SNAPSHOT.jar
AWS Access Key: 20 characters long, starts with A
AWS Secret Key: 40 characters long, starts with 3
Wait for deployment: true
Recovery wait time: 30
Uploading file to bucket elasticbeanstalk-us-east-1-002446295643
New build successfully uploaded to S3, bucket=elasticbeanstalk-us-east-1-002446295643, key=/aws-backend/b2c9b111300de097271b341ec7fa63fbdbff4f16.zip
Error: Deployment failed: Error: Status: 400. Code: InvalidParameterValue, Message: No Application named 'aws-backend' found.
Just wondering if anyone has an idea on where the issue lies with this, I've tried to replicate this locally, but only have an issue with the beanstalk-deploy script running in GitHub. I am still unsure if the issues lies with Beanstalk, Github, or this Action.
Here are the logs from the failed deployment, I made all the sensitive information X
.
From Beanstalk, the error is this, it always expects the old version. Locally running beanstalk-deploy
from CLI, it works just fine, though.
Incorrect application version "X-1607792162" (deployment 29). Expected version "X-1607790305" (deployment 27).
Action logs:
Beanstalk-Deploy: GitHub Action for deploying to Elastic Beanstalk.
https://github.com/einaregilsson/beanstalk-deploy
***** Input parameters were: *****
Application: X
Environment: X-env
Version Label: X-1607789180
Version description:
AWS Region: us-east-2
File: /home/runner/work/core/core/backend/X/build.zip
AWS Access Key: 20 characters long, starts with X
AWS Secret Key: 40 characters long, starts with X
Wait for deployment: true
Recovery wait time: 30
Uploading file to bucket elasticbeanstalk-us-east-2-606767603402
New build successfully uploaded to S3, bucket=elasticbeanstalk-us-east-2-606767603402, key=/X/X-1607789180.zip
Created new application version X-1607789180 in Beanstalk.
Starting deployment of version X-1607789180 to environment X-env
Deployment started, "wait_for_deployment" was true...
16:07:20 INFO: Environment update is starting.
16:07:25 INFO: Deploying new version to instance(s).
16:07:28 INFO: Deleted log fragments for this environment.
16:07:29 INFO: Instance deployment found a runtime-dependent .NET Core application in your source bundle.
16:07:31 ERROR: Instance deployment failed. For details, see 'eb-engine.log'.
16:07:35 ERROR: [Instance: i-X] Command failed on instance. Return code: 1 Output: Engine execution has encountered an error..
16:07:35 INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
16:07:36 ERROR: Unsuccessful command execution on instance id(s) 'i-X'. Aborting the operation.
16:07:36 ERROR: Failed to deploy application.
16:07:36 ERROR: During an aborted deployment, some instances may have deployed the new application version. To ensure all instances are running the same version, re-deploy the appropriate application version.
16:07:42 ERROR: Deployment failed! Current State: Version: X-1607561434, Health: Yellow, Health Status: Warning
Hey there
Thank you for this plugin. I've tried taking it and commiting it to my repo, adding the AWS secrets etc but github refuses to run it. The error is
every step must define a uses or run key
I have literally the same file as in the documented sample except for lines 23 to 25 where I made some obvious string literal changes to suit my env - the version_label
is hardcoded to 1
application_name: MyApplicationName
environment_name: MyApplication-Environment
version_label: 12345
Any suggestions?
I'm having troubles getting beanstalk-deploy
to work inside my GitHub Actions, keep getting 403
error.
Run einaregilsson/beanstalk-deploy@v1
with:
aws_access_key: ABC123
aws_secret_key: XYZ789
application_name: our-beanstalk-app
environment_name: our-beanstalk-app-env
region: ca-central-1
version_label: 8
deployment_package: deploy.zip
env:
CI: true
AWS_ACCESS_KEY_ID: ABC123
AWS_SECRET_ACCESS_KEY: XYZ789
Uploading file to bucket elasticbeanstalk-ca-central-1-302080953439
##[error]Deployment failed: Error: Status: 403. Message:
##[error]Node run failed with exit code 2
I installed the package locally and able to successfully run it from the command line:
AWS_ACCESS_KEY_ID=ABC123 AWS_SECRET_ACCESS_KEY=XYZ789 beanstalk-deploy our-beanstalk-app our-beanstalk-app-env 8 ca-central-1 deploy.zip
Any ideas why it's working from the command line but not via GitHub Actions?
Config
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v16
with:
aws_access_key: ${{ secrets.STAGING_AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.STAGING_AWS_SECRET_ACCESS_KEY }}
application_name: 'Cloud Backup'
environment_name: st-tb-cb-webapp-v3
version_label: rewind-app-${{github.SHA}}
version_description: Commit ${{github.SHA}} deployed by github actions
region: us-east-1
deployment_package: deploy.zip
use_existing_version_if_available: true
wait_for_deployment: true
wait_for_environment_recovery: 60
When running 2 deploys from the same job, i'm getting
Deployment failed: Error: Version rewind-app-07b8f5987797bb85fc36d8219679bb081cda158b already exists in S3!
I thought this was due to a previous failure but to test this I just put 2 deploys one after the other one. The first one works, but the second fails with the S3 error.
I'm wondering if it has something to do with the space in the EB Application name OR that the app name is prepended to the source? This is what shows for app versions - I can see that 07b8f5987797bb85fc36d8219679bb081cda158b
is clearly there.
Hi!
This action seems like a great idea! I'm trying to set up my workflow to upload my web application as a zip through GitHub Actions: https://github.com/JackMcKew/docker-react. Please find my relevant Github action logs at: https://github.com/JackMcKew/docker-react/actions.
Although, I've spent hours and no matter the combination of inputs, the action always errors out on https://github.com/einaregilsson/beanstalk-deploy/blob/master/beanstalk-deploy.js#L261 and prints accordingly. From further tracing, this conditional only runs if IS_GITHUB_ACTION is false, which is set by: https://github.com/einaregilsson/beanstalk-deploy/blob/master/beanstalk-deploy.js#L7.
I'm unsure as to why it isn't detecting that it is running as a GitHub action.
I'm getting this after trying to rebuild the github's workflow
##[error]Deployment failed: Error: Version ${ APP_NAME }-${ github.sha } already exists in S3!
Which is normal because the build failed but the package is uploaded the S3 bucket. So is there something to not throw an error but instead of it to use the existing package from the bucket ?
I'm using version 10 (einaregilsson/beanstalk-deploy@v10)
AWS Region: ${ AWS_REGION }
File: ${ APP_NAME }-${ github.sha }.zip
AWS Access Key: 20 characters long, starts with X
AWS Secret Key: 40 characters long, starts with X
Wait for deployment: true
Recovery wait time: 30
Thank you 👍
Basically, after zipping the jar the zip file is sent to deploy to BE, this was working at some point but now after the deploy starts and the command giving a successful response the environment starts and then is on an unresponsive state, not even the bad gateway error.
I already check all the logs from BE and I could not find a root cause any ideas?
Here are the steps I been using
- name: Generate deployment package
run: zip -j app-0.0.1-SNAPSHOT.jar.zip app-0.0.1-SNAPSHOT.jar
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v16
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: app
environment_name: dev-api
region: us-east-1
version_label: ${{ steps.vars.outputs.sha_short }}
deployment_package: app-0.0.1-SNAPSHOT.jar
I'm getting a 403 error when deploying my application.
The problem seems to be my application version string 0.0.0-dev+440e3f0
which uses the +
character to add commit hash metadata to the version number (as permitted by the semver spec)
This looks to be the same issue as #28 (and in particular @einaregilsson's fix mentioned here addresses some special characters, but not +
).
Would it be possible to add +
to the list of allowed (and escaped) characters?
I've run today into a case similar to #19, where the deployment failed because I'd just changed the environment configuration, but re-running the job subsequently wouldn't work because that version label already existed. I know I can change the current version manually, but not everyone with commit access to this repo has access to the AWS, so they should be able to re-run the jobs and have it work.
Since this is something not everyone might want, it'd be better to have it as a flag.
If my Elastic Beanstalk application has a space in its name, e.g. "Application Name", and I attempt to run your script then I get the following errors:
Deployment failed: TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters
Do you reckon you can fix that?
im runing a single container with dockerrun.aws.json
Hello guys in receiving that error when i use a new version label
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: vennly-player:develop
environment_name: vennly-player-develop-env
version_label: v1
region: us-east-2
deployment_package: deploy.zip
if i remove deployment_package property and use the running version as version label it works
but i need to run a new dockerrun.aws.json with an updated image name which is inside the zip file.
Any Ideas?
I wonder if its worth adding an option to specify acceptable environment "states" (colours).
This is useful to be able to deploy to a scaled-down environment. For example; in a staging environment that gets automatically shutdown overnight I would want to deploy the code before any instances have been scaled up. This saves time on deploying new code to such environments, especially when an immutable deployment policy is used. In such a scenario the environment would never get to be green and so the deployment would "fail" but of course it hasn't actually failed at all. Using wait_for_deployment doesnt help because it just fires and forgets.
First off, thanks for this action, it is invaluable and thanks for being so responsive to issues.
I was wondering if we could could add something like the WAIT
parameter here and default it to true
: https://confluence.atlassian.com/bitbucket/deploy-to-aws-with-elastic-beanstalk-976772710.html
Reason I ask: Immutable deployments take a long time and eat up Github Action minutes.
I got a redirect status when uploading file to bucket.
Beanstalk-Deploy: GitHub Action for deploying to Elastic Beanstalk.
https://github.com/einaregilsson/beanstalk-deploy
***** Input parameters were: *****
Application: myappname
Environment: myappname-dev
Version Label: 85cd20103466b8c87f2bc16c3183351648fe838d
Version description:
AWS Region: us-west-2
File: deploy.zip
AWS Access Key: 20 characters long, starts with B
AWS Secret Key: 40 characters long, starts with x
Wait for deployment: true
Recovery wait time: 30
Uploading file to bucket elasticbeanstalk-us-west-2-160185919304
##[error]Deployment failed: Error: Status: 307. Message:
Probably because I created the app few hours ago (https://aws.amazon.com/premiumsupport/knowledge-center/s3-http-307-response/).
Sounds fine to me that Action
handle the redirect, WDYT?
Hi, @einaregilsson !
Thanks for creating this tool to create Elastic beanstalk deployments.
I'd like to request a feature that allows the consumer to modify the awsApiRequest
function options so that we can modify the host. For global regions this works fine as shown below:
beanstalk-deploy/aws-api-request.js
Line 17 in ebe3476
However in China, regions like cn-north-1
and cn-northwest-1
regions have their API endpoints pointing to ${service}.${region}.amazonaws.com.cn
(Note the .cn
TLD)
Since I needed this on a project for work, I was wondering if there's a way to be able to implement this on your library. I'll be happy to open a PR.
I've been experimenting with GitHub Environments and it'd be great if this Action returned the deployment url as an output
.
This way I can set the GitHub Environment's url so all I have to do is click the environment name in GitHub to view the website.
From the readme:
You can also use the action to deploy an existing version. To do this simply omit the deployment-package input parameter. The action will then assume that the version you pass in throught version_label already exists in Beanstalk and attempt to deploy that.
I am interested in a solution to the situation where the desired behavior is to:
deployment-package
Basically, ignore deployment-package
if the version already exists on s3.
This would address the following error that occurs if you deploy to multiple environments as demonstrated in #5 (comment):
Deployment failed: Error: Version XXXX already exists in S3!
In our case, XXXX is the source commit hash, so we don't have to worry about version being ambiguous.
name: Your app name
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v1
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Installing NPM
run: npm install
- name: Generate deployment package
run: zip -r deploy.zip * -x "**node_modules**"
- name: Get timestamp
uses: gerred/actions/current-time@master
id: current-time
- name: Run string replace
uses: frabert/replace-string-action@master
id: format-time
with:
pattern: '[:\.]+'
string: "${{ steps.current-time.outputs.time }}"
replace-with: '-'
flags: 'g'
- name: docker build
run: sudo docker build -f Dockerfile .
- name: Beanstalk Deploy for app
uses: einaregilsson/beanstalk-deploy@v9
with:
aws_access_key: ${{secrets.AWS_ACCESS_KEY}}
aws_secret_key: ${{secrets.AWS_SECRET_KEY}}
application_name: node-js-for-ebs
environment_name: node-js-for-ebs-dev
region: us-west-2
version_label: "my-app-${{ steps.format-time.outputs.replaced }}"
deployment_package: deploy.zip
- name: Deployed!
run: echo App deployed to ELB
I have the following error Cannot read property 'DescribeApplicationVersionsResult' of undefined
.
I checked the code and it seems that it breaks at beanstalk-deploy.js:243
.
I tried with aws elasticbeanstalk describe-application-versions --application-name {my-app}
and I have a successful response, so, it seems that the bug is related to beanstalk-deploy
.
When deploying with a multi-lined description, it always raises a 403 error like:
Beanstalk-Deploy: GitHub Action for deploying to Elastic Beanstalk.
https://github.com/einaregilsson/beanstalk-deploy
***** Input parameters were: *****
Application: xxx
Environment: xxx-develop
Version Label: xxx-20201217-114430
Version description: Feature/marketing (#55)
* fix FacebookCreative columns
* [AD-190] ad on/off
* [AD-191] PUT /ads/{id}
AWS Region: ap-northeast-2
File: xxx.zip
AWS Access Key: 20 characters long, starts with A
AWS Secret Key: 40 characters long, starts with z
Wait for deployment: true
Recovery wait time: 30
Uploading file to bucket elasticbeanstalk-ap-northeast-2-xxx
New build successfully uploaded to S3, bucket=elasticbeanstalk-ap-northeast-2-xxx, key=/xxx/xxx-20201217-114430.zip
Error: Deployment failed: Error: Status: 403. Code: SignatureDoesNotMatch, Message: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
It is because our team merges PR by squashing commits as shown:
Version description: Feature/marketing (#55)
* fix FacebookCreative columns
* [AD-190] ad on/off
* [AD-191] PUT /ads/{id}
Of course, we can modify the merge message when deploying the app by deleting an auto-generated message, and I'm not sure the action or Beanstalk itself causes the error.
I am seeing this error in the Elastic Beanstalk logs:
2019-11-17 21:27:22,941 [ERROR] Command hooks (HooksExecutor.exe appdeploy\enact) failed
2019-11-17 21:27:22,941 [ERROR] Error encountered during build of Hook-EnactAppDeploy: Command hooks failed
Traceback (most recent call last):
File "cfnbootstrap\construction.pyc", line 544, in run_config
File "cfnbootstrap\construction.pyc", line 138, in run_commands
File "cfnbootstrap\command_tool.pyc", line 117, in apply
ToolError: Command hooks failed
2019-11-17 21:27:22,941 [ERROR] -----------------------BUILD FAILED!------------------------
2019-11-17 21:27:22,941 [ERROR] Unhandled exception during build: Command hooks failed
Traceback (most recent call last):
File "cfn-init", line 171, in
File "cfnbootstrap\construction.pyc", line 129, in build
File "cfnbootstrap\construction.pyc", line 530, in build
File "cfnbootstrap\construction.pyc", line 544, in run_config
File "cfnbootstrap\construction.pyc", line 138, in run_commands
File "cfnbootstrap\command_tool.pyc", line 117, in apply
ToolError: Command hooks failed
I am honestly lost as to why it is not working for me. Here is the deploy job in my yml:
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v3
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_ID }}
application_name: BudgeIt
environment_name: dev-budgeit
version_label: 11202013717
region: us-east-1
deployment_package: deployment.zip
Hi @einaregilsson ,
Are you planning to add license to this repository? I am planning on using/contributing to this package so just thought licensing makes things much easier.
Regards,
Bhautik
Thx for your great plug-in for deploy!
I am wondering you have a plan to upgrade for delivery .ebextention files to beanstalk?
Deployment is failing on merge commit.
Deployment settings:
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v11
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: <removed>
environment_name: production
region: ${{ secrets.AWS_DEFAULT_REGION }}
version_label: ${{ github.sha }}
version_description: ${{ github.event.head_commit.message }}
deployment_package: deploy.zip
use_existing_version_if_available: true
Error:
Deployment failed: Error: Status: 403. Code: SignatureDoesNotMatch, Message: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
There is really no issue with access keys or secret as it works perfectly when I commit directly into the branch. It only fails when I merge my dev branch to the master branch.
Logs (partial):
2020-09-22T16:54:00.2446915Z BUILD SUCCESSFUL in 57s
2020-09-22T16:54:00.2447630Z 3 actionable tasks: 3 executed
2020-09-22T16:54:00.5847453Z ##[group]Run cp build/libs/*.jar serverapp.jar & zip -r deploy.zip serverapp.jar Procfile .ebextensions
2020-09-22T16:54:00.5848566Z �[36;1mcp build/libs/*.jar serverapp.jar & zip -r deploy.zip serverapp.jar Procfile .ebextensions�[0m
2020-09-22T16:54:00.5890258Z shell: /bin/bash -e {0}
2020-09-22T16:54:00.5890553Z env:
2020-09-22T16:54:00.5890961Z JAVA_HOME_8.0.265_x64: /opt/hostedtoolcache/jdk/8.0.265/x64
2020-09-22T16:54:00.5891488Z JAVA_HOME: /opt/hostedtoolcache/jdk/8.0.265/x64
2020-09-22T16:54:00.5892010Z JAVA_HOME_8_0_265_X64: /opt/hostedtoolcache/jdk/8.0.265/x64
2020-09-22T16:54:00.5892427Z ##[endgroup]
2020-09-22T16:54:03.9697737Z adding: serverapp.jar (deflated 10%)
2020-09-22T16:54:03.9698838Z adding: Procfile (stored 0%)
2020-09-22T16:54:03.9699720Z adding: .ebextensions/ (stored 0%)
2020-09-22T16:54:03.9700347Z adding: .ebextensions/options.config (deflated 17%)
2020-09-22T16:54:03.9825004Z ##[group]Run einaregilsson/beanstalk-deploy@v11
2020-09-22T16:54:03.9825502Z with:
2020-09-22T16:54:03.9826586Z aws_access_key: ***
2020-09-22T16:54:03.9827400Z aws_secret_key: ***
2020-09-22T16:54:03.9827766Z application_name: XXX
2020-09-22T16:54:03.9828207Z environment_name: production
2020-09-22T16:54:03.9828633Z region: ***
2020-09-22T16:54:03.9829152Z version_label: bf1ba7ee459838a32b453680880b2f31242d9fd2
2020-09-22T16:54:03.9829887Z version_description: Merge remote-tracking branch 'origin/master'
2020-09-22T16:54:03.9830475Z deployment_package: deploy.zip
2020-09-22T16:54:03.9830934Z use_existing_version_if_available: true
2020-09-22T16:54:03.9831289Z env:
2020-09-22T16:54:03.9831682Z JAVA_HOME_8.0.265_x64: /opt/hostedtoolcache/jdk/8.0.265/x64
2020-09-22T16:54:03.9832206Z JAVA_HOME: /opt/hostedtoolcache/jdk/8.0.265/x64
2020-09-22T16:54:03.9832722Z JAVA_HOME_8_0_265_X64: /opt/hostedtoolcache/jdk/8.0.265/x64
2020-09-22T16:54:03.9833215Z ##[endgroup]
2020-09-22T16:54:04.0357856Z Beanstalk-Deploy: GitHub Action for deploying to Elastic Beanstalk.
2020-09-22T16:54:04.0361263Z https://github.com/einaregilsson/beanstalk-deploy
2020-09-22T16:54:04.0362107Z
2020-09-22T16:54:04.0362690Z ***** Input parameters were: *****
2020-09-22T16:54:04.0363485Z Application: XXX
2020-09-22T16:54:04.0364126Z Environment: production
2020-09-22T16:54:04.0365026Z Version Label: bf1ba7ee459838a32b453680880b2f31242d9fd2
2020-09-22T16:54:04.0366400Z Version description: Merge remote-tracking branch 'origin/master'
2020-09-22T16:54:04.0367655Z AWS Region: ***
2020-09-22T16:54:04.0368299Z File: deploy.zip
2020-09-22T16:54:04.0368978Z AWS Access Key: 20 characters long, starts with A
2020-09-22T16:54:04.0369722Z AWS Secret Key: 40 characters long, starts with r
2020-09-22T16:54:04.0370392Z Wait for deployment: true
2020-09-22T16:54:04.0370979Z Recovery wait time: 30
2020-09-22T16:54:04.0371427Z
2020-09-22T16:54:05.8511590Z Uploading file to bucket elasticbeanstalk-***-XXX
2020-09-22T16:54:14.1356959Z New build successfully uploaded to S3, bucket=elasticbeanstalk-***-XXX, key=/XXX/bf1ba7ee459838a32b453680880b2f31242d9fd2.zip
2020-09-22T16:54:14.7553847Z ##[error]Deployment failed: Error: Status: 403. Code: SignatureDoesNotMatch, Message: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
I'm getting a variety of permissions errors trying to get this working. Is there an effective minimum IAM policy I need to apply to the AWS User who's keys I'm supplying to this GitHub Action?
Hi.
Please has anyone used this action to deploy a Go app? I am a bit confused about how this action will handle the Go application build.
Thank you.
Not sure why this started failing. Does it not use the aws_access_key
although provided perhaps?
Run einaregilsson/beanstalk-deploy@v10
with:
aws_access_key: ***
aws_secret_key: ***
application_name: myservice
environment_name: myservice-env
version_label: ef404dbe438457836316cd4ebe53b2b6afe99874
region: us-east-1
deployment_package: build/distributions/my-service.zip
wait_for_deployment: false
env:
JAVA_HOME_8.0.265_x64: /opt/hostedtoolcache/jdk/8.0.265/x64
JAVA_HOME: /opt/hostedtoolcache/jdk/8.0.265/x64
JAVA_HOME_8_0_265_X64: /opt/hostedtoolcache/jdk/8.0.265/x64
beanstalk-deploy: Deploy a zip file to AWS Elastic Beanstalk
https://github.com/einaregilsson/beanstalk-deploy
Usage: beanstalk-deploy.js <application> <environment> <versionLabel> <region> [<filename>]
Environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY must be defined for the program to work.
If <filename> is skipped the script will attempt to deploy an existing version named <versionLabel>.
I am getting the following error in case I push 2 commits in a very small duration. The first commit gets deployed successfully, however, the second commit fails because the EBS state from the first commit is still not in the ready state.
Is there any potential solution to this problem?
Here is the script I am using
- name: Beanstalk Deploy
uses: einaregilsson/beanstalk-deploy@v9
with:
# AWS Access Key
aws_access_key: {{my-key}}
# AWS Secret Key
aws_secret_key: {{my-secret}}
# AWS Region
region: us-west-1
# Beanstalk application name
application_name: {{app-name}}
# Beanstalk environment name
environment_name: {{my-env}}
# Version label for new Beanstalk version
version_label: "${{ steps.timestamp.outputs.date }}"
# Zip file with the version to deploy. If skipped the action will deploy existing version.
deployment_package: {{package-name}}
# If set to "true" then the action will deploy an existing version with the given version_label if it already exists, but otherwise create the version and deploy it.
use_existing_version_if_available: false
# Whether the action should wait for the deployment to finish and log status messages during the wait. Default is "true". If set to "false" the action will start the deployment on Beanstalk and then exit.
# wait_for_deployment: # optional
# How many seconds to wait for the environment to return to Green state after deployment is finished. Default is 30 seconds.
wait_for_environment_recovery: 600
specific version is not required during testing
Is there a way to automatically create a version?
Everything I try results in an error, it seems impossible to use.
This is my config:
steps:
- name: checkout
uses: actions/checkout@v2
- name: Generate deployment package
run: zip -r deploy.zip docker-compose.yml Dockerrun.aws.json
- name: Deploy to Elastic Beanstalk
uses: einaregilsson/beanstalk-deploy@v17
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: archimedes
environment_name: dev-archimedes
region: eu-west-1
version_label: ${{github.run_id}}
version_description: none
deployment_package: deploy.zip
Using existing version
steps:
- name: checkout
uses: actions/checkout@v2
- name: Generate deployment package
run: zip -r deploy.zip docker-compose.yml Dockerrun.aws.json
- name: Deploy to Elastic Beanstalk
uses: einaregilsson/beanstalk-deploy@v17
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: archimedes
environment_name: dev-archimedes
region: eu-west-1
version_label: Sample Application
version_description: none
deployment_package: deploy.zip
With use_existing_version_if_available: true
steps:
- name: checkout
uses: actions/checkout@v2
- name: Generate deployment package
run: zip -r deploy.zip docker-compose.yml Dockerrun.aws.json
- name: Deploy to Elastic Beanstalk
uses: einaregilsson/beanstalk-deploy@v17
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: archimedes
environment_name: dev-archimedes
region: eu-west-1
version_label: "Sample Application"
version_description: none
deployment_package: deploy.zip
use_existing_version_if_available: true
I'm currently having issues with my project while deployment.
A Bad Gateway message appears and throws a failed status into the test, but everything was right in terms of artifacts (even the deployment was successfully deployed on the server)
Deployment failed: Error: Status: 502. Message: <html>
Any insights?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.