amazon-web-servicesazureazure-devopsdevopsamazon-ecr

##[warning]Task 'AWS Shell Script' version 1 (AWSShellScript@1) is dependent on a Node version (10)


My Azure DevOps Pipeine getting below warning:

##[warning]Task 'Amazon ECR Push' version 1 (ECRPushImage@1) is dependent on a Node version (10) that is end-of-life. Contact the extension owner for an updated version of the task. Task maintainers should review Node upgrade guidance: https://aka.ms/node-runner-guidance

My Pipeline tasks:

     - task: AWSShellScript@1
     displayName: Docker build ${{ appService.name }}
      inputs:
        regionName: '${{ parameters.ecrRegion }}'
        scriptType: 'inline'
        inlineScript: |
          aws ecr get-login-password --region ${{ parameters.ecrRegion }}| docker login --username AWS --password-stdin $(ecrURL)
          echo -e "FROM ${{ parameters.openJDKImage }} \nRUN mkdir /artifact && apk add openssl \nCOPY ${{ appService.name }}-$(JAR_SNAPSHOT_VERSION).jar /artifact/service.jar \nCMD [\"/bin/sh\", \"-c\", \"java -jar /artifact/service.jar\"]" > Dockerfile | docker build . -t $(ecrURL)/${{ appService.ecrRepo }}:$(VERSION)-$(COMMIT)
        disableAutoCwd: true
        workingDirectory: '$(System.DefaultWorkingDirectory)'
- task: ECRPushImage@1
        displayName: Push ${{ appService.name }} image to DEV ECR
        inputs:
          regionName: '${{ parameters.ecrRegion }}'
          sourceImageName: '$(ecrURL)/${{ appService.ecrRepo }}'
          sourceImageTag: '$(VERSION)-$(COMMIT)'
          repositoryName: '${{ appService.ecrRepo }}'
          pushTag: '$(VERSION)-$(COMMIT)'
          outputVariable: '$(ecrURL)/${{ appService.ecrRepo }}:$(VERSION)-$(COMMIT)'

We are using Azure DevOps default agents for pipeline runs. i also tried to update the task to 2 but its not working.

Pls any one have the information, let me know.


Solution

  • @brucewayne

    The warning error you are seeing is a known issue with the AWS Toolkit for Azure DevOps extension and you can follow discussions: ECRPushImage warning in Azure Devops due to Node10 dependency

    ##[warning]Task 'Amazon ECR Push' version 1 (ECRPushImage@1) is dependent on a Node version (10) that is end-of-life. Contact the extension owner for an updated version of the task. Task maintainers should review Node upgrade guidance: https://aka.ms/node-runner-guidance

    If this becomes a significant problem, consider using alternative tasks, such as Bash@3 and Docker@2 and avoid using tasks from the extension, while this is been fixed.

    I have tried a simple pipeline with Docker task: The full yaml file is here: https://github.com/iheanacho-chukwu/aks-hellowebapi/blob/deploy-to-ecr/docker-task-aws.yml

    - script: |
        echo "Logging in to AWS ECR"
        aws ecr get-login-password --region $(AWS_REGION) | docker login --username AWS --password-stdin $(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com
      displayName: 'Login to AWS'
      env:
        AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID)
        AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
    
    - task: Docker@2
      displayName: Build and Push Docker Image
      inputs:
        repository: $(DOCKER_REPOSITORY)
        command: buildAndPush
        Dockerfile: Dockerfile
        tags: |
          $(TAG)
    

    enter image description here another one using entirely bash: https://github.com/iheanacho-chukwu/aks-hellowebapi/blob/deploy-to-ecr/push-docker-image-ecr-using-bash.yml

    - script: |
        echo "Logging in to AWS ECR"
        aws ecr get-login-password --region $(AWS_REGION) | docker login --username AWS --password-stdin $(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com
      displayName: 'Login to AWS'
      env:
        AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID)
        AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
    
    - script: |
        docker build -t $(DOCKER_REPOSITORY):$(TAG) .
        docker tag $(DOCKER_REPOSITORY):$(TAG) $(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com/$(DOCKER_REPOSITORY_NAME):$(TAG)
        docker push $(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com/$(DOCKER_REPOSITORY_NAME):$(TAG)
      displayName: 'Build and Push Docker Image using Bash Script'
      env:
        AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID)
        AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
    

    I passed my AWS credential as Azure DevOps variable group, so I dont have to hardcode to repo.

    enter image description here