sourcetoad / aws-codedeploy-action Goto Github PK
View Code? Open in Web Editor NEWAWS CodeDeploy via GitHub Actions
License: MIT License
AWS CodeDeploy via GitHub Actions
License: MIT License
I have an error using v1.11.0 and v1
Build container for action use: '/opt/actions-runner/_work/_actions/sourcetoad/aws-codedeploy-action/v1.11.0/Dockerfile'.
/home/ubuntu/bin/docker build -t 456935:06d9fb7a8d1f40d481[2](https://github.com/abaqusinc/allgeo-server/actions/runs/9671528017/job/26682306923#step:3:2)2359352c46268 -f "/opt/actions-runner/_work/_actions/sourcetoad/aws-codedeploy-action/v1.11.0/Dockerfile" "/opt/actions-runner/_work/_actions/sourcetoad/aws-codedeploy-action/v1.11.0"
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/buildx/
Sending build context to Docker daemon 18[3](https://github.com/abaqusinc/allgeo-server/actions/runs/9671528017/job/26682306923#step:3:3).8kB
Step 1/4 : FROM amazon/aws-cli:2.17.0
2.17.0: Pulling from amazon/aws-cli
[4](https://github.com/abaqusinc/allgeo-server/actions/runs/9671528017/job/26682306923#step:3:4)92439933c1f: Pulling fs layer
659dcd9fe751: Pulling fs layer
cadf92deee9d: Pulling fs layer
42aa93e9233a: Pulling fs layer
87a391e9688b: Pulling fs layer
42aa93e9233a: Waiting
87a391e9688b: Waiting
6[5](https://github.com/abaqusinc/allgeo-server/actions/runs/9671528017/job/26682306923#step:3:5)9dcd9fe751: Verifying Checksum
659dcd9fe751: Download complete
42aa93e9233a: Verifying Checksum
42aa93e9233a: Download complete
87a391e9688b: Verifying Checksum
87a391e9688b: Download complete
492439933c1f: Verifying Checksum
492439933c1f: Download complete
cadf92deee9d: Verifying Checksum
cadf92deee9d: Download complete
failed to register layer: failed to Lchown "/dev/console" for UID 0, GID 0: lchown /dev/console: no such file or directory
Warning: Docker build failed with exit code 1, back off 5.794 seconds before retry.
/home/ubuntu/bin/docker build -t 456935:06d9fb7a8d1f40d48122359352c46268 -f "/opt/actions-runner/_work/_actions/sourcetoad/aws-codedeploy-action/v1.11.0/Dockerfile" "/opt/actions-runner/_work/_actions/sourcetoad/aws-codedeploy-action/v1.11.0"
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/buildx/
Sending build context to Docker daemon 183.8kB
Step 1/4 : FROM amazon/aws-cli:2.17.0
2.17.0: Pulling from amazon/aws-cli
492439933c1f: Pulling fs layer
[6](https://github.com/abaqusinc/allgeo-server/actions/runs/9671528017/job/26682306923#step:3:6)59dcd9fe[7](https://github.com/abaqusinc/allgeo-server/actions/runs/9671528017/job/26682306923#step:3:7)51: Pulling fs layer
cadf92deee9d: Pulling fs layer
42aa93e9233a: Pulling fs layer
[8](https://github.com/abaqusinc/allgeo-server/actions/runs/9671528017/job/26682306923#step:3:8)7a3[9](https://github.com/abaqusinc/allgeo-server/actions/runs/9671528017/job/26682306923#step:3:9)1e9688b: Pulling fs layer
42aa93e9233a: Waiting
87a391e9688b: Waiting
659dcd9fe751: Verifying Checksum
659dcd9fe751: Download complete
42aa93e9233a: Verifying Checksum
42aa93e9233a: Download complete
87a391e9688b: Verifying Checksum
87a391e9688b: Download complete
cadf92deee9d: Verifying Checksum
cadf92deee9d: Download complete
492439933c1f: Verifying Checksum
492439933c1f: Download complete
failed to register layer: failed to Lchown "/dev/console" for UID 0, GID 0: lchown /dev/console: no such file or directory
Warning: Docker build failed with exit code 1, back off 4.595 seconds before retry.
/home/ubuntu/bin/docker build -t 456935:06d9fb7a8d1f40d48122359352c46268 -f "/opt/actions-runner/_work/_actions/sourcetoad/aws-codedeploy-action/v1.[11](https://github.com/abaqusinc/allgeo-server/actions/runs/9671528017/job/26682306923#step:3:11).0/Dockerfile" "/opt/actions-runner/_work/_actions/sourcetoad/aws-codedeploy-action/v1.11.0"
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/buildx/
Sending build context to Docker daemon 183.8kB
Step 1/4 : FROM amazon/aws-cli:2.[17](https://github.com/abaqusinc/allgeo-server/actions/runs/9671528017/job/26682306923#step:3:17).0
2.17.0: Pulling from amazon/aws-cli
492439933c1f: Pulling fs layer
659dcd9fe751: Pulling fs layer
cadf92deee9d: Pulling fs layer
42aa93e9233a: Pulling fs layer
87a391e9688b: Pulling fs layer
42aa93e9[23](https://github.com/abaqusinc/allgeo-server/actions/runs/9671528017/job/26682306923#step:3:23)3a: Waiting
87a391e9688b: Waiting
659dcd9fe751: Verifying Checksum
659dcd9fe751: Download complete
42aa93e9233a: Verifying Checksum
42aa93e9233a: Download complete
87a391e9688b: Verifying Checksum
87a391e9688b: Download complete
cadf92deee9d: Verifying Checksum
cadf92deee9d: Download complete
49[24](https://github.com/abaqusinc/allgeo-server/actions/runs/9671528017/job/26682306923#step:3:24)39933c1f: Verifying Checksum
492439933c1f: Download complete
failed to register layer: failed to Lchown "/dev/console" for UID 0, GID 0: lchown /dev/console: no such file or directory
Error: Docker build failed with exit code 1
Please help me ... It is very urgent
Sed command does nothing and we deploy node_modules and a bulky zip file.
Our properties (required) if missing cause downstream issues. Lets validate out of box.
⚠️ Found 2 unscanned files that could potentially be supported:
cleanup.sh
deploy.sh
ShellCheck only supports sh/bash/dash/ksh scripts. For supported scripts to be scanned, make sure to add a proper shebang on the first line of the script.
Saw that because I was curious why files were linting so fast.
Take a look to see if this repo can be open-sourced (as-is) or if we need to strip commits and restart it.
Error: 937040804-38f1812cbfafe541627f2eae2692acf151c1c1c7.zip being using as zip filename. Skipping generation of ZIP.
Error: appspec.yml was not located at: ./
what we mention at directory
Our deployment group is blue/green with copy autoscaling group.
When the deployment starts and the action begins polling aws deploy get-deployment
, this does not return the deploymentOverview
object until the new ASG and instances are ready.
The action seems to continue fine anyway and once the instances are ready and deployment starts then it works as normal.
The log below is the last poll before instances were running and the first after.
/deploy.sh: line 65: [: null: integer expression expected
Deployment in progress. Sleeping 15 seconds. (Try 18)
Instance Overview: Failed (null), In-Progress (null), Skipped (null), Pending (null), Succeeded (null)
Deployment Status: InProgress
Deployment in progress. Sleeping 15 seconds. (Try 19)
Instance Overview: Failed (0), In-Progress (1), Skipped (0), Pending (1), Succeeded (0)
Deployment Status: InProgress
It would be nice if the task could use the credentials set up by the
https://github.com/aws-actions/configure-aws-credentials task.
This would help avoid having to refresh the secret in the repo settings and use AWS roles instead
Readme mentions S3 permission, but not exact CodeDeploy permissions.
I know it needs at least:
codedeploy:RegisterApplicationRevision
for applcationscodedeploy:CreateDeployment
and list deployments (I just used codedeploy:List*
) for deployment groupsI'd make a PR, but I'm not sure what the exact policies are, because took a bit of a shortcut and used some *
and permissions I used for a previous implementation I was using.
v1
tag on Tuesday - March 28, 2023Using ${ORANGE}Foo
will allow no space vs current of $ORANGE Foo
which requires the space.
Turns out you have to register the outputs your script makes
--
This will allow a tweak to the job to deploy an existing revision for projects that may generate 1 zip and send to many many servers.
If you stop a deployment its done, over, etc. We shouldn't poll forever.
Hi, I have the following question!
From what I understand, this action, in addition to deploying, also compresses the application first and sends it to s3, correct? I'm wanting to use this action, but I already sent my application to s3 in a previous step, is it possible to just use deploy?
I've tried steps recommended in #29 , but I still can't tell what's going wrong. I've added debug secret variables and I'm using v1.0.3 of this action.
This is the most verbose output I could get out of the action
...
##[debug]Input variables correctly validated.
##[debug]Zip directory located (with appspec.yml).
##[debug]Exclusion file created for files to ignore in Zip Generation.
##[debug]Zip Archive created.
##[debug]Zip Archived validated.
##[debug]Docker Action run completed with exit code 1
##[debug]Finishing: AWS CodeDeploy
In CodeDeploy panel I see no new releases. Bucket name is correct, policy gives access to it, AWS credentials also seem correct.
Any idea how can I debug this?
While we poll for the instances we should output a list of the servers with status so if we detect a failure we can fail build.
appspec.yml
is not found, but it exists.
Repo:
https://github.com/econominhas/backend
GithubAction:
https://github.com/econominhas/backend/blob/master/.github/workflows/api-deploy.yml
Usage:
- name: AWS CodeBuild & CodeDeploy
uses: sourcetoad/aws-codedeploy-action@v1
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_region: ${{ secrets.AWS_REGION }}
codedeploy_name: Econominhas
codedeploy_group: development_gropup
s3_bucket: econominhas-dev-api-deploy
s3_folder: api
excluded_files: '.git/* .github/* .husky/* .vscode/* localstack/* openapi/* .dockerignore .editorconfig .eslintrc.js .gitignore .lintstagedrc .nvmrc .prettierrc docker-compose.yml Dockerfile.dev jest.config.json LICENSE README.md redocly.yaml'
max_polling_iterations: 60
Pipe:
https://github.com/econominhas/backend/actions/runs/7427009109/job/20211875467
Hey, thanks for the amazing package!
I was thinking if there is a way to disable polling to save a action minutes. I tried to setting max_polling_iterations
to 0
but then it errors out that deployment wasnt successfull, except deployment on codedeploy works fine.
You can't use a variable in an expression as a parameter. So if I wanted to allow customization for end user to pick variables, we have to pass them in via yaml which eats the variable into literal or passes variable as literal. So no good way here.
Remove the variable, our default is sane - s3_prefix
.
The plugin should be able to take an optional parameter archive
which is a CodeDeploy compatible ZIP. If it passes validation and exists in the bucket, we skip directly to the register/deploy.
We should introduce a dry_run
true|false flag that skips any uploading and/or communication with S3. That way folks can test the binaries produced before they fire them off to any AWS service.
They could just register vs deploy, but its been found that even registering revisions has downstream possibilities.
Our API call for looking for deployments scans ENTIRE deployment. So if you are deploying master, then run a build for staging. It will poll/wait on that. We should fix that so you can have both staging/master going at once.
echo $GITHUB_RUN_ID-$GITHUB_SHA.zip
// 474524530-36d2fd3092a9883df9a2f0ce290f0944534a793f.zip
Need to compare to what our existing thing (Jenkins) builds to see if thats close enough or anyone uses the name of the zip file.
I'm trying to build and deploy my Java app to an EC2 instance using CodeDeploy. There are 7 steps in my yml file. The last step is where I run sourcetoad/[email protected]
. GitHub Actions doesn't state the reason why the step fails.
Here's my yml file:
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: CI with Maven
on:
# Triggers the workflow on push request event but only for the master branch
push:
branches: [ master ]
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checkout the master branch
- name: Step 1 - Checkout master branch from GitHub
uses: actions/checkout@v2
# Ensure the JDK is been setup
- name: Step 2 - Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# Build the project with Maven
- name: Step 3 - Have GitHub Actions build the project with Maven
run: mvn -B package --file pom.xml
# Copy the jar to a folder called staging
- name: Step 4 -Copy the jar file
run: mkdir staging && cp target/*.jar staging
# Cache all the dependencies to speed up the workflow runs
- name: Step 5 - Set up a cache for Maven
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
# Package the artificate and allow us to download them. This is useful for re-testing in local environment
- name: Step 6 - Persist workflow data as astifacts
uses: actions/upload-artifact@v2
with:
name: github-actions-artifact
path: staging
- name: Step 7 - Sourcetoad - AWS CodeDeploy for GitHub Actions
uses: sourcetoad/[email protected]
with:
# AWS Access Key
aws_access_key: ***
# AWS Secret Key
aws_secret_key: ${{ secrets.AWS_SECRET_KEY }}
# AWS Region
aws_region: ap-southeast-1
# S3 Bucket for CodeDeploy Assets
s3_bucket: ***
# S3 Folder for ZIP.
s3_folder: /
# AWS CodeDeploy Application Name
codedeploy_name: ***
# AWS CodeDeploy Application Group
codedeploy_group: ***
And the output:
Need to support a flag to deploy a revision or register one.
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.