Git Product home page Git Product logo

aws-codedeploy-action's People

Contributors

ardens-jw avatar bennettp123 avatar dependabot[bot] avatar ibotpeaches avatar vacoris avatar william-brooks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-codedeploy-action's Issues

Failed to register layer: failed to Lchown "/dev/console"

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

Validation

Our properties (required) if missing cause downstream issues. Lets validate out of box.

Fix Bash Linting

 ⚠️  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.

Audit for Open Source

Take a look to see if this repo can be open-sourced (as-is) or if we need to strip commits and restart it.

Archive is a warning, not info

Error: 937040804-38f1812cbfafe541627f2eae2692acf151c1c1c7.zip being using as zip filename. Skipping generation of ZIP.

directory error

Error: appspec.yml was not located at: ./

what we mention at directory

Error with Blue Green deployment

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

Documentation

  • add readme
  • add info about minimal IAM role needed
  • give some examples of using workflow (redact project specific examples)

Missing CodeDeploy permissions in recommended IAM policy in README (?)

Readme mentions S3 permission, but not exact CodeDeploy permissions.

I know it needs at least:

  • codedeploy:RegisterApplicationRevision for applcations
  • codedeploy:CreateDeployment and list deployments (I just used codedeploy:List*) for deployment groups

I'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.

Cut 1.6.0

  • Release 1.6.0 on Monday - March 27, 2023
  • Move v1 tag on Tuesday - March 28, 2023

Expose output for common information

  • We should expose the name of the archive that was created

--

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.

S3 step

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?

Action fails with no output

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?

Error: appspec.yml was not located at: ./

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

How to disable polling

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.

Retire S3_PREFIX

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.

Support already built archive

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.

Dry Run Feature

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.

Support grouping for codedeploy

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.

Name of ZIP

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.

Step fails without any error shown

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:

Screenshot 2021-03-18 at 3 54 14 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.