Deleted Jenkins custom action type, now receiving errors

0

Hi all

I am new to CodePipeLine and CodeDeploy so go easy on me but I have setup a simple pipeline which deploys a JavaScript application to an EC2 instance via GitHub so that any changes I make to the master repo are pushed to the EC2 instance and it works great.

Next I wanted to add a validation / test step via Jenkins to play around with the Jenkins plugin for CodePipeLine and I specified "Add Jenkins" in the Test Provider, I got some errors in the validation step (Jenkins related not CPL) so I shut down my EC2 instances for the night.

Today I brought them back up and of course the IP has changed for my Jenkins instance, fine, so I try to update the test step in CPL for my Jenkins provider but I can't find where to edit it (the URL to my Jenkins host) so I thought I will just delete and re-create it but it keeps telling me Jenkins V1 already exists when I try to add it back, so not thinking just edit the URL via the CLI I deleted the custom action but now it won't let me re-create it!!!! (using the same method through the browser) it just keeps throwing up the error: "Custom ActionType (Category: 'Test', Provider: 'Jenkins', Version: '1') has been deleted. Create a new version of the action type".

If I try to recreate via the CLI it just tells me the above, the only way I can do it is specify version 2?? but then it is missing elements / fields that were originally automatically populated for me via the browser method. I am a bit lost here I just want (for now) to be able to re-add this step via the GUI as I did before - what have I done wrong?

Thanks

Edited by: 1000101011 on Sep 26, 2017 2:29 PM

Hmm ok I should have paid attention to this via the CLI:

"NAME
delete-custom-action-type -

DESCRIPTION
Marks a custom action as deleted. poll-for-jobs for the custom action
will fail after the action is marked for deletion. Only used for custom
actions.

   WARNING:  
      You cannot recreate a custom action after it has been deleted unless  
      you increase the version number of the action.  

   See also: AWS API Documentation"  

....so does this effectively mean I can no longer create this custom action via the browser because it always try to create version 1? thats crazy.

Edited by: 1000101011 on Sep 26, 2017 2:33 PM

asked 5 years ago17 views
2 Answers
0

Ok so just in case anyone else finds this, i had to create an entirely new version of this custom action using the AWS CLI - I used the JSON template in the AWS CodePipeLine user guide and amended using the old values (luckily I had still got the custom action fields from the original in my terminal buffer):

vi <yourfile>.json

{
"category": "Test",
"provider": "Jenkins",
"version": "3",
"settings": {
"entityUrlTemplate": "https://<your_jenkins_ip>:8080/job/{Config:ProjectName}",
"executionUrlTemplate": "https://<your_jenkins_ip>:8080/job/{Config:ProjectName}/{ExternalExecutionId}"
},
"configurationProperties": [{
"name": "ProjectName",
"required": true,
"key": true,
"secret": false,
"queryable": true,
"description": "The name of the build project must be provided when this action is added to the pipeline.",
"type": "String"
}],
"inputArtifactDetails": {
"maximumCount": 5,
"minimumCount": 0
},
"outputArtifactDetails": {
"maximumCount": 5,
"minimumCount": 0
}
}

$ aws codepipeline create-custom-action-type --cli-input-json file://jenkins_provider.json

....but I still can't add this now using the browser method, it just try to use Version 1 all the time and errors which is really annoying, don't suppose anyone knows a fix other than contacting AWS? you live and learn huh! (it is just for study purposes this project using my account).

answered 5 years ago
0

Hello,

You are right that if custom action is updated via web-console version field is missed. Possible workarounds are to use API/CLI as you've done or create an action with the new name.

Thanks for bringing this to our attention! I don't have any ETA, but this issue is added to our backlog.

Few notes:

  1. CodePipeline does not use 'Server URL' parameter of custom action to communicate with Jenkins. So even if instance's IP has changed Jenkins will be able to poll CodePipeline for jobs (but URL to the job in the CodePipeline web-console will be broken).
  2. You can look at CodeBuild service [1] for your unit/integration tests to avoid having dedicated Jenkins instance all the time.

Best,
Ruslan.

[1] http://docs.aws.amazon.com/codebuild/latest/userguide/welcome.html

answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions