Giter Club home page Giter Club logo

aws-codedeploy-plugin's Introduction

AWS CodeDeploy Jenkins Plugin

The AWS CodeDeploy Jenkins plugin provides a post-build step for your Jenkins project. Upon a successful build, it will zip the workspace, upload to S3, and start a new deployment. Optionally, you can set it to wait for the deployment to finish, making the final success contingent on the success of the deployment.

Build Status

Build Status

Setting up

After building and installing the plugin, some simple configuration is needed for your project.

Freestyle

  1. Open up your project configuration
  2. In the Post-build Actions section, select "Deploy an application to AWS CodeDeploy"
  3. Application Name, Deployment Group, Deployment Config, and region are all required options.
  4. For authentication, there are two options. Either option requires that the associated role has, at minimum, a policy that permits codedeploy:* and s3:Put*.
  5. Access/Secret key pair. For example, the keys associated with a specific IAM user. If left blank, the default chain of credentials will be checked.
  6. Temporary access keys. These will use the global keys from the Jenkins instance.

Pipeline

  1. Create a Jenkins Pipeline project
  2. Use the Pipeline Snippet Generator
  3. For 'Sample Step', choose 'step: General Build Step'
  4. For 'Build Step', choose 'Deploy an application to AWS CodeDeploy'
  5. populate variables and then 'Generate Groovy'

Here is a rather blank example:

step([$class: 'AWSCodeDeployPublisher', applicationName: '', awsAccessKey: '', awsSecretKey: '', credentials: 'awsAccessKey', deploymentGroupAppspec: false, deploymentGroupName: '', deploymentMethod: 'deploy', excludes: '', iamRoleArn: '', includes: '**', proxyHost: '', proxyPort: 0, region: 'ap-northeast-1', s3bucket: '', s3prefix: '', subdirectory: '', versionFileName: '', waitForCompletion: false])

License

This plugin is licensed under Apache 2.0. See the LICENSE file for more information.

aws-codedeploy-plugin's People

Contributors

alecharp avatar ansoni avatar asaf-erlich avatar cafuego avatar ccloes-intuit avatar christ66 avatar cojennin avatar cosmincatalin avatar feverlu avatar hollowdrutt avatar jmcfar avatar jones2026 avatar michaelneale avatar ndeloof avatar noodlesnz avatar suryanarayanan avatar ydubreuil 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-codedeploy-plugin's Issues

Deploy Test Fails

Jenkins Version: Jenkins ver. 1.588
Code Deploy Plugin Version. 1.8 and 1.9 tested

Process to replicate:

1 - Install plugin manually via the .hpi file.
2- Restarted Jenkins
3 - Create job and add post build action for Code Deploy
4 - Entered required fields
5 - Run Jobs.
6 - Immediate error.

Troubleshooting.

No dependencies are listed, however I checked the plugins/libs folder to confirm the right joda-time version jar was in there. Other than that, not much else to test.

Error Logs:

ERROR: Publisher com.amazonaws.codedeploy.AWSCodeDeployPublisher aborted due to exception
java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.auth.AWS4Signer
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:374)
at java.lang.Class.newInstance(Class.java:327)
at com.amazonaws.auth.SignerFactory.createSigner(SignerFactory.java:121)
at com.amazonaws.auth.SignerFactory.lookupAndCreateSigner(SignerFactory.java:107)
at com.amazonaws.auth.SignerFactory.getSigner(SignerFactory.java:80)
at com.amazonaws.AmazonWebServiceClient.computeSignerByServiceRegion(AmazonWebServiceClient.java:311)
at com.amazonaws.AmazonWebServiceClient.computeSignerByURI(AmazonWebServiceClient.java:284)
at com.amazonaws.AmazonWebServiceClient.setEndpoint(AmazonWebServiceClient.java:160)
at com.amazonaws.services.codedeploy.AmazonCodeDeployClient.setEndpoint(AmazonCodeDeployClient.java:1881)
at com.amazonaws.services.codedeploy.AmazonCodeDeployClient.init(AmazonCodeDeployClient.java:347)
at com.amazonaws.services.codedeploy.AmazonCodeDeployClient.(AmazonCodeDeployClient.java:231)
at com.amazonaws.codedeploy.AWSClients.(AWSClients.java:73)
at com.amazonaws.codedeploy.AWSClients.fromBasicCredentials(AWSClients.java:86)
at com.amazonaws.codedeploy.AWSCodeDeployPublisher.perform(AWSCodeDeployPublisher.java:196)
at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
at hudson.model.Run.execute(Run.java:1784)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Finished: FAILURE

Use Ec2 IAM profile

It be nice to use the IAM profile of the Ec2 server that the plugin running on instead of providing keys.

NullPointerException in getSourceDirectory

The 'subdirectory' field of my configuration is empty in all my jobs using this plugin, but they have all just started to fail with this exception.

jenkins: 1.622
plugin: 1.6

null
java.lang.NullPointerException
at com.amazonaws.codedeploy.AWSCodeDeployPublisher.getSourceDirectory(AWSCodeDeployPublisher.java:235)
at com.amazonaws.codedeploy.AWSCodeDeployPublisher.perform(AWSCodeDeployPublisher.java:215)
at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:381)
Build step 'Deploy an application to AWS CodeDeploy' marked build as failure
Finished: FAILURE

Make CodeDeploy DeploymentID an environment variable

With this the deployment id can be passed to another build to check for successful instances using this:
aws deploy list-deployment-instances --deployment-id $DeploymenID --instance-status-filter Succeeded

Old Builds

There doesn't seem to be a clean way to remove old builds. My initial thought was use the S3 versioning. However since the zip file upload is different name each time, that wont work. Also can't use time based removal as if you have a long period with no build, it might delete the current version.

Can't parameterize the deployment group

I have a set up deployment groups that I want to automation Jenkins. Each build is exactly the same except for the name of the deployment group. I tried to create a parameterized build but the fields for the CodeDeploy plugin do not substitute from the parameters. Here is the console output:
CODEDEPLOYGROUP=CodeDeployDesignGroup-group-Jim

[EnvInject] - Variables injected successfully.
Failed CodeDeploy post-build step; exception follows.
Cannot find deployment group named '${CODEDEPLOYGROUP}'
java.lang.IllegalArgumentException: Cannot find deployment group named '${CODEDEPLOYGROUP}'

Nothing displays when selecting Deploy an Application to AWS Code Deploy

Within my job configuration, when I select "Deploy and Application to AWS CodeDeploy" from the post-build action dropdown, nothing happens. I am not presented with the parameters to deploy my app. I looked in my javascript console and get the following error in my browser:

GET http://internal-awslbjenkinsed01-572120769.us-east-1.elb.amazonaws.com/job/…l-awslbjenkinsed01-572120769.us-east-1.elb.amazonaws.com%2F&credentialsId= 504 (GATEWAY_TIMEOUT)

I have confirmed this with multiple users and multiple browsers, with both 1.5 and 1.6 of aws-codedeploy-plugin. We are running Jenkins 1.596.2

Missing Option for S3 Server-Side Encryption

We have pretty hard security restrictions and are not allowed to have any bucket in our account without server side encryption policy. Is it possible to pass the encryption option for the S3 upload to have the same effect as the --sse AES256 option in AWS cli?

Add support for cn-north-1

As you may know, codedeploy has been lauched in China, thus it would be great if we can use this plugin soon. Thanks.

Host the plugin in the Jenkins org

I'd like to encourage that the plugin be hosted in the Jenkins org. The process is outlined here, and you can see that other AWS related plugins are already there.

This way we can help you with releases, bug fixes, and improvements. This will also help us make this plugin available from the update center to users, so that people won't have to build it from source.

If you are OK with it, I'm happy to do all the work, including 1.0 release assuming that's what you want. Or if you want to set up the release process on your own, I can work with you, too.

Allow custom S3 archive name

By default, archive uploaded to S3 bucket is named after Jenkins job name plus commit SHA. It will be nice to allow user to define archive name pattern. For instance, rather than using commit SHA, build number can be used to construct name.

Provide change log for plugin

It would be very helpful to have a change log that summarizes each release of the plugin. This could include new features, bug fixes, enhancements, or other information. The de facto convention appears to be a file called CHANGELOG.md in the root of a repository. Here's some unofficial info about GitHub change logs (it even has its own change log)...

https://github.com/olivierlacan/keep-a-changelog/blob/gh-pages/README.md

On a related note, each release could be tagged in order to populate this list...

https://github.com/awslabs/aws-codedeploy-plugin/releases

And finally, thank you for providing a REALLY useful plugin! I really appreciate it.

Fails for ap-south-1 region

I am using plugin version 1.12. region is ap-south-1 (Mumbai) which is added recently. Upgrading the project to aws java sdk > 1.11.36 should fix it.

java.lang.IllegalArgumentException: Cannot create enum from ap-south-1 value!
at com.amazonaws.regions.Regions.fromName(Regions.java:73)
at com.amazonaws.codedeploy.AWSClients.(AWSClients.java:74)
at com.amazonaws.codedeploy.AWSClients.fromIAMRole(AWSClients.java:82)
at com.amazonaws.codedeploy.AWSCodeDeployPublisher.perform(AWSCodeDeployPublisher.java:209)
at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Build step 'Deploy an application to AWS CodeDeploy' marked build as failure

Plugin does not support .NET published code

It seems the plugin only support the build artifacts. For an ASP.NET project, the project is not just built, but published. The published build is in a different location than the workspace. Can the plugin allow me to just specify the folder that I want it to package up instead of just taking the workspace?

Can't parameterize the Subdirectory

Trying to parameterize a .net deployment for different environments and not being able to parametrize subdirectory (1.9 version).

java.lang.IllegalArgumentException: Provided path (resolved as '${PROFILE}') is not a subdirectory of the workspace (resolved as '...')
    at com.amazonaws.codedeploy.AWSCodeDeployPublisher.getSourceDirectory(AWSCodeDeployPublisher.java:244)
    at com.amazonaws.codedeploy.AWSCodeDeployPublisher.perform(AWSCodeDeployPublisher.java:218)
    at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
    at hudson.model.Run.execute(Run.java:1763)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)

Error: BundleType must be either YAML or JSON

I'm trying to deploy a lambda function written in go and getting the following error:

Zipping files into /tmp/#10-Resources:
-   myfunc:
        Properties:
            Alias: main
            CurrentVersion: ''
            Name: myfunc
            TargetVersion: 0.0.10
        Type: AWS::Lambda::Function
version: 0.0.10.zip
Uploading zip to s3://my-bucket/myfunc/#10-Resources:
-   myfunc:
        Properties:
            Alias: main
            CurrentVersion: ''
            Name: myfunc
            TargetVersion: 0.0.10
        Type: AWS::Lambda::Function
version: 0.0.10.zip
Registering revision for application 'MyFunc'
Failed CodeDeploy post-build step; exception follows.
BundleType must be either YAML or JSON (Service: AmazonCodeDeploy; Status Code: 400; Error Code: InvalidRevisionException; Request ID: 5c46c0da-2124-11e8-9f19-914d46cbd854)
com.amazonaws.services.codedeploy.model.InvalidRevisionException: BundleType must be either YAML or JSON (Service: AmazonCodeDeploy; Status Code: 400; Error Code: InvalidRevisionException; Request ID: 5c46c0da-2124-11e8-9f19-914d46cbd854)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1639)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1304)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1056)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:743)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:717)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:699)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:667)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:649)
	at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:513)
	at com.amazonaws.services.codedeploy.AmazonCodeDeployClient.doInvoke(AmazonCodeDeployClient.java:3358)
	at com.amazonaws.services.codedeploy.AmazonCodeDeployClient.invoke(AmazonCodeDeployClient.java:3334)
	at com.amazonaws.services.codedeploy.AmazonCodeDeployClient.executeRegisterApplicationRevision(AmazonCodeDeployClient.java:2839)
	at com.amazonaws.services.codedeploy.AmazonCodeDeployClient.registerApplicationRevision(AmazonCodeDeployClient.java:2813)
	at com.amazonaws.codedeploy.AWSCodeDeployPublisher.registerRevision(AWSCodeDeployPublisher.java:403)
	at com.amazonaws.codedeploy.AWSCodeDeployPublisher.perform(AWSCodeDeployPublisher.java:232)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
	at hudson.model.Build$BuildExecution.post2(Build.java:186)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
	at hudson.model.Run.execute(Run.java:1749)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)

codedeploy-local fails with symlink() function is unimplemented on this machine (NotImplementedError)

PS C:\Windows\system32> C:\ProgramData\Amazon\CodeDeploy\bin\codedeploy-local.exe --bundle-location c:/temp/bundle.tar --type tar --file-exists-behavior OVERWRITE
Starting to execute deployment from within folder Amazon/CodeDeploy/default-local-deployment-group/d-9C0E8D5NQ-local
See the deployment log at Amazon/CodeDeploy/default-local-deployment-group/d-9C0E8D5NQ-local/logs/scripts.log for more details
C:/Users/kbrodin/AppData/Local/Temp/ocr75DA.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:352:in symlink': symlink() function is unimplemented on this machine (NotImplementedError) from C:/Users/kbrodin/AppData/Local/Temp/ocr75DA.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:352:in handle_local_file'
from C:/Users/kbrodin/AppData/Local/Temp/ocr75DA.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:97:in block in <class:CommandExecutor>' from C:/Users/kbrodin/AppData/Local/Temp/ocr75DA.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:68:in execute_command'
from C:/Users/kbrodin/AppData/Local/Temp/ocr75DA.tmp/src/opt/codedeploy-agent/lib/aws/codedeploy/local/deployer.rb:85:in block in execute_events' from C:/Users/kbrodin/AppData/Local/Temp/ocr75DA.tmp/src/opt/codedeploy-agent/lib/aws/codedeploy/local/deployer.rb:84:in each'
from C:/Users/kbrodin/AppData/Local/Temp/ocr75DA.tmp/src/opt/codedeploy-agent/lib/aws/codedeploy/local/deployer.rb:84:in execute_events' from C:/Users/kbrodin/AppData/Local/Temp/ocr75DA.tmp/src/opt/codedeploy-agent/bin/codedeploy-local:117:in

'

Subdirectory field not working / causes exception

No matter what I put into the "subdirectory" field, I get this exception - even when I leave it blank.

Suggestions?

Failed CodeDeploy post-build step; exception follows.
Provided path is not a subdirectory of the workspace: /var/lib/jenkins-slave/workspace/TestApp-CodeDeploy-Test
java.lang.IllegalArgumentException: Provided path is not a subdirectory of the workspace: /var/lib/jenkins-slave/workspace/TestApp-CodeDeploy-Test
    at com.amazonaws.codedeploy.AWSCodeDeployPublisher.getSourceDirectory(AWSCodeDeployPublisher.java:242)
    at com.amazonaws.codedeploy.AWSCodeDeployPublisher.perform(AWSCodeDeployPublisher.java:215)
    at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
    at hudson.model.Run.execute(Run.java:1766)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:381)
Build step 'Deploy an application to AWS CodeDeploy' marked build as failure
Finished: FAILURE

ETag mismatch in CodeDeploy

CodeDeploy is not liking the application bundle created by this plugin. I'm getting the following error from CodeDeploy:

"The request signature we calculated does not match the signature you provided. Check your key and signing method."

zip does not include all dirs

I have the following config which won't include some directories in the zip file, even though I don't use any excludes.
in the workspace directory I can see that these ones exist, but once the archive is built and transferred to s3, they don't anymore.
Config attached:
2017-12-12 21_33_20

The dirs are:
storage
bootstrap/cache
There might be more, but who knows. This is very weird.

Connect AWS with Jenkins(Installed in localhost)

Hi,

I have installed Jenkins in my local windows machine and I m trying to use AWS EBS deploy plugin. I have provided my Access key ID & Secret Access key. But I am getting below error. I JUST WANTED TO KNOW HOW SHOULD I ESTABLISH CONNECTION BETWEEN LOCALHOST & AWS

com.amazonaws.services.s3.model.AmazonS3Exception: Service Unavailable (Service: Amazon S3; Status Code: 503; Error Code: 503 Service Unavailable; Request ID: null), S3 Extended Request ID: null
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1343)
at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:961)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:738)
at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:489)
at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:448)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:397)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:378)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:4039)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3976)
at com.amazonaws.services.s3.AmazonS3Client.listBuckets(AmazonS3Client.java:867)
at com.amazonaws.services.s3.AmazonS3Client.listBuckets(AmazonS3Client.java:873)
at br.com.ingenieux.jenkins.plugins.awsebdeployment.AWSEBDeploymentBuilder$DescriptorImpl.doValidateCredentials(AWSEBDeploymentBuilder.java:298)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:324)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:167)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:100)
at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124)
at rg.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)

at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:80)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)

at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)

at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)

at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)

at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)

at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)

at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

at org.eclipse.jetty.server.Server.handle(Server.java:499)

at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)

at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)

at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)

at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Allow Symlinks in Subdirectory

Inside of this:
private FilePath getSourceDirectory(FilePath basePath) throws IOException, InterruptedException {
String subdirectory = StringUtils.trimToEmpty(this.subdirectory);
if (!subdirectory.isEmpty() && !subdirectory.startsWith("/")) {
subdirectory = "/" + subdirectory;
}
FilePath sourcePath = basePath.withSuffix(subdirectory).absolutize();
if (!sourcePath.isDirectory() || !isSubDirectory(basePath, sourcePath)) {
throw new IllegalArgumentException("Provided path (resolved as '" + sourcePath
+"') is not a subdirectory of the workspace (resolved as '" + basePath + "')");
}
return sourcePath;
}

Can we get another clause that will allow for symlinks to also not throw the illegal argument?

Documentation on "Use temporary credentials"

The "Use temporary credentials" feature of the plugin needs better documentation.

If this uses the AWS Security Token Service, could you provide some example of how to set that up? It looks like the Security Token Service needs to be specifically enabled for each region, and then you need to create a Trust Policy (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html).

I'm not at all clear on what role I need, what permissions are needed for that role, or how to configure the trust policy -- could you add that to the docs?

Also The help text has this documentation:

This plugin uses temporary access keys via the AWS Security Token Service. For instructions on setting this up, see the help text on the "IAM Role ARN" field above

There is no "IAM Role ARN" field above to refer to, and thus no additional help text.

Thank you.

Temporary Credentials Not Working: can't get account aws id

Environment:
Jenkins ver 2.1
AWS CodeDeploy Plugin ver 1.11

May 03, 2016 3:22:20 PM hudson.ExpressionFactory2$JexlExpression evaluate
WARNING: Caught exception evaluating: descriptor.accountId in /$stapler/bound/d85fcff4-ade2-47d7-bddf-854bf0a8fea3/render. Reason: java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
...
Caused by: com.amazonaws.AmazonClientException: Unable to load AWS credentials from any provider in the chain
at com.amazonaws.auth.AWSCredentialsProviderChain.getCredentials(AWSCredentialsProviderChain.java:131)
at com.amazonaws.services.identitymanagement.AmazonIdentityManagementClient.invoke(AmazonIdentityManagementClient.java:7398)
at com.amazonaws.services.identitymanagement.AmazonIdentityManagementClient.getUser(AmazonIdentityManagementClient.java:4219)
at com.amazonaws.services.identitymanagement.AmazonIdentityManagementClient.getUser(AmazonIdentityManagementClient.java:4231)
at com.amazonaws.codedeploy.AWSClients.getAccountId(AWSClients.java:104)
at com.amazonaws.codedeploy.AWSCodeDeployPublisher$DescriptorImpl.getAccountId(AWSCodeDeployPublisher.java:528)

i've tried adding the aws key\secret pair at all possible places - jenkins credentials, plugin configuration (under 'manage'), env-injected to specific job - all failed.
using the same pair at "Use Access/Secret keys" option works as expected.
Am i missing something?

Add new regions

Is it possible to add Europe regions to codedeploy plugin following the availability of Codedeploy in Europe Today ?

AWS Secret Access Key / Secret not saving

It appears the AWS Access Key / Secret fields do not save properly. No matter what I put in the field, they always come back empty. This is true on both the global as well as job-specific settings.

Not sure if related or a different problem, but when trying to use alternative method of injecting environment variables for AWS_ACCESS_KEY and AWS_SECRET_KEY, the plugin does not seem to recognize and use them either.

Integration with ECS for new image deployments

Hi,

It would be great if this plugin can be enhanced to support new ECS deployments where we just specify the ECS cluster, service name and docker image tag, and it just takes the existing task definition the service is mapped to and updates the image tag to the new one and updates the ecs service to the new ecs task revision. Ideally, if this works with Jenkins pipeline that would be great. Or, perhaps it's better to create a entirely new ECS deploy plugin?

Thanks

Job doesn't find appspec file

I'm trying to build and deploy on a Jenkins node, and as long as the appspec has no "Per Deployment" configuration, the job completes (i.e., regular appspec.yml)

If I choose the option of "Appspec.yml per Deployment Group", the job never completes with the following error:

Failed CodeDeploy post-build step; exception follows.
/appspec.staging.yml file does not exist
java.lang.IllegalArgumentException: /appspec.staging.yml file does not exist
	at com.amazonaws.codedeploy.AWSCodeDeployPublisher.zipAndUpload(AWSCodeDeployPublisher.java:349)
	at com.amazonaws.codedeploy.AWSCodeDeployPublisher.perform(AWSCodeDeployPublisher.java:230)
	at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:682)
	at hudson.model.Build$BuildExecution.post2(Build.java:186)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:627)
	at hudson.model.Run.execute(Run.java:1749)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:419)
Build step 'Deploy an application to AWS CodeDeploy' marked build as failure
Finished: FAILURE

I've tried using a custom Workspace, and even copying the file to the remote FS root to no avail.

Any help on how to successfully build and deploy from a node would be greatly appreciated.

AWS CodeDeploy Jenkin Plugin Failing on AWS Linux Java 1.8

My specs are the following

AWS Linux US-EAST Recent
Jenkins ver. 2.110
java-1.8.0-openjdk-devel
AWS CodePipeline Plugin Version .34

Issue

When attempting to complete the Integrating Jenkins with AWS CodePipeline tutorial on AWS developers site I configure the plugin as stated and go to SAVE/APPLY.

https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-four-stage-pipeline.html#tutorials-four-stage-pipeline-prerequisites-jenkins-configure

Every-time I receive the following error.

Please provide any guidance or direction. Thanks in advance y'all

Stack trace
java.lang.NullPointerException
at com.amazonaws.codepipeline.jenkinsplugin.AWSCodePipelineSCM.(AWSCodePipelineSCM.java:137)
at com.amazonaws.codepipeline.jenkinsplugin.AWSCodePipelineSCM$DescriptorImpl.newInstance(AWSCodePipelineSCM.java:378)
at com.amazonaws.codepipeline.jenkinsplugin.AWSCodePipelineSCM$DescriptorImpl.newInstance(AWSCodePipelineSCM.java:346)
at hudson.DescriptorExtensionList.newInstanceFromRadioList(DescriptorExtensionList.java:142)
at hudson.scm.SCMS.parseSCM(SCMS.java:59)
at hudson.model.AbstractProject.submit(AbstractProject.java:1802)
at hudson.model.Project.submit(Project.java:225)
at hudson.model.Job.doConfigSubmit(Job.java:1350)
at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:772)
at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:77)
at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:117)
at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:129)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
Caused: javax.servlet.ServletException
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:765)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:99)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:564)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

I've also tested with

java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

Where i replaced openJDK as alternative with Java SE 1.8 then I restarted Jenkins from the UI

Stack trace
java.lang.NullPointerException
at com.amazonaws.codepipeline.jenkinsplugin.AWSCodePipelineSCM.(AWSCodePipelineSCM.java:137)
at com.amazonaws.codepipeline.jenkinsplugin.AWSCodePipelineSCM$DescriptorImpl.newInstance(AWSCodePipelineSCM.java:378)
at com.amazonaws.codepipeline.jenkinsplugin.AWSCodePipelineSCM$DescriptorImpl.newInstance(AWSCodePipelineSCM.java:346)
at hudson.DescriptorExtensionList.newInstanceFromRadioList(DescriptorExtensionList.java:142)
at hudson.scm.SCMS.parseSCM(SCMS.java:59)
at hudson.model.AbstractProject.submit(AbstractProject.java:1802)
at hudson.model.Project.submit(Project.java:225)
at hudson.model.Job.doConfigSubmit(Job.java:1350)
at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:772)
at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:77)
at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:117)
at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:129)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
Caused: javax.servlet.ServletException
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:765)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:99)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:564)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

CodeDeploy application name cannot be parameterized

Similar to #24, probably - I have a CI pipeline architecture that requires multiple CodeDeploy application names, and the plugin is telling me that the parameter is not recognized.(Cannot find application named '$CODEDEPLOY_APPNAME').

Any way to fix this at this time?

Aws green blue

Hi,

When will this plug-in support green blue deployments, looking at Jenkins its not clear if it does or if any other changes are required.

Access key and secret credentials are not saved

After installing the plugin, adding it as a build step, and entering credentials (key and secret), I click save. Then, I click "Configure" on the project again and the credentials have disappeared. When building the project, there is then an error:

Failed CodeDeploy post-build step; exception follows.
Unable to load AWS credentials from any provider in the chain
com.amazonaws.AmazonClientException: Unable to load AWS credentials from any provider in the chain
    at com.amazonaws.auth.AWSCredentialsProviderChain.getCredentials(AWSCredentialsProviderChain.java:117)
    at com.amazonaws.services.codedeploy.AmazonCodeDeployClient.invoke(AmazonCodeDeployClient.java:1919)
    at com.amazonaws.services.codedeploy.AmazonCodeDeployClient.listApplications(AmazonCodeDeployClient.java:620)
    at com.amazonaws.services.codedeploy.AmazonCodeDeployClient.listApplications(AmazonCodeDeployClient.java:1776)
    at com.amazonaws.codedeploy.AWSCodeDeployPublisher.verifyCodeDeployApplication(AWSCodeDeployPublisher.java:218)
    at com.amazonaws.codedeploy.AWSCodeDeployPublisher.perform(AWSCodeDeployPublisher.java:194)
    at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
    at hudson.model.Build$BuildExecution.post2(Build.java:183)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
    at hudson.model.Run.execute(Run.java:1779)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:89)
    at hudson.model.Executor.run(Executor.java:240)
Build step 'Deploy an application to AWS CodeDeploy' marked build as failure

I've tried repeatedly entering the credentials and clicking save, but every time they disappear.

Workflow compatibility

Consider making AWSCodeDeployPublisher implement SimpleBuildStep (and perhaps some other changes as necessary) so that it can be used from within a Jenkins Workflow build.

Migration guide

Temporary Credentials Not Working: External ID without Cause

I'm using the "Temporary Credentials" option, however the "External ID" unpredictably changes.
I have been able to successfully setup multiple CodeDeploys and have them work consistently for a few days. However the "External ID" unexplainably changes and obviously subsequent CodeDeploy's fail until I re-associate the new “External ID” to the “AWS Account ID” and “IAM Role ARN”.

The “AWS Account ID” and the “IAM Role ARN” do not and have not been changed.

My environment is :

  • Jenkins ver 1.656
  • JAVA ver 1.8.0_74-b02
  • AWS CodeDeploy Plugin ver 1.11
  • Windows 2012 Server R2

What is the causing the External ID to change? How can I prevent it?

Environment variables for credentials are not working

I am trying to use environment variables for credentials, I am able to inject and show the environment variables in a post install script, but codedeploy plugin is not able to use them, showing the following error:
is not authorized to perform: codedeploy:ListApplications on resource.. (Service: AmazonCodeDeploy; Status Code: 400; Error Code: AccessDeniedException; Request ID: ..)

I does work when I explicitly use the key id and access key on the form.

I am using 1.8 version of the plugin I am not sure if this is has been fixed on 1.9 looking at the changes appear that is not. In any case I will try the latest plugin later and will update this.

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.