Octopus To Trigger AWS Code Pipeline

Hello There,

Currently, we have deployment system setup where AWS Code Pipeline is getting code from Amazon S3 where S3 is updated with our source code with the Jenkins Job that pulls code from TFS and drops it to S3. AWS Code Pipeline is deploying the content from S3 to our Amazon EC2 Instances. As AWS Code Pipeline doesn’t have an offering on pulling code directly from TFS Source Control.

I was wondering, if anyone can help me out if i can use Octopus to Trigger AWS Code Pipeline seamlessly, as octopus can pull code directly from TFS Source Control.

Please let me know for any information on the same. Thanks

Tarun

Hi Tarun,

Thanks for getting in touch! To ensure I understand your scenario fully, can you expand on what your requirements and preferences are, and what goals you’re looking to accomplish?
Which part of your process you’ve described isn’t working? Is the issue that AWS Code Pipeline doesn’t auto detect changes on S3 and start execution?

I’d like to point out that I personally haven’t done this, but I have some general thoughts which may help. While we don’t have any built-in support to trigger Code Pipeline from Octopus, Code Pipeline does have an API in which you can call to trigger it to execute. This would have to be scripted either in another Jenkins step (after you drop it in your S3 bucket) or in an Octopus step. AWS documentation has you covered here in this API reference guide: http://docs.aws.amazon.com/codepipeline/latest/APIReference/Welcome.html

I look forward to hearing back!

Best regards,

Kenny

Hello Kenny,

Thank you for your reply.

Certainly. Please find attached for the full flow on how our current deployment is setup.

Sure, will look at the link provided above. Thanks

Tarun

Hi Tarun,

Thanks for following up with that image explaining your process! In which step of your process are you having an issue? Is your AWS Code Pipeline unable to automatically detect changes on S3 to start execution? Additionally, more info on what you’re trying to achieve will help us understand your requirements and help you find a good solution :slight_smile:

Best regards,

Kenny

Hello Kenny,

Thank you for your reply. Sure, as per the above flow chart we are getting source artifacts from TFS with the help of a Jenkins job and dropping these artifacts at the AWS S3. Is there a way where we can use octopus to get source artifacts from TFS Source Control and trigger the AWS Code Pipeline directly, this way we can skip the step of Jenkins to get source from TFS. Hope it answered your query.

Please let me know for any further information. Thanks

Tarun

Hi Tarun,

Can I confirm - when you say artifacts, are you meaning packages (Zip or NuGet)? You can push your packaged builds from TFS to Octopus via OctoPack. We have some fantastic documentation on integrating Octopus with TFS, along with info on using OctoPack to package and push, which you can find here: https://octopus.com/docs/api-and-integration/team-foundation-server-tfs

From here, you’d need to use a custom script in an Octopus step to trigger AWS Code Pipeline to execute. As mentioned before, you may be able to do this by calling the API. Here’s the AWS API Reference guide :slight_smile:
http://docs.aws.amazon.com/codepipeline/latest/APIReference/Welcome.html

I hope this helps. Let me know if you have any further questions.

Best regards,

Kenny

Hello Kenny,

Thank you for your reply.

Yes, i had referred to artifacts to the package which is in a Zip Format.
As you mentioned we can push the packaged builds from TFS to Octopus via Octopac. Does this require a separate VM to install the Octopus Suite. Or just the command line arguments in the TFS build is sufficient without any octopus suite installations?
Also, thank you for sending me the reference links will go through these links and get back to you if i have any further queries. For now, i think this is what i was in need for.

Tarun

Hi Tarun,

That’s no problem. I’m not sure I fully understand your question, so I apologize if that’s the case. Feel free to correct me if I’m mistaken.

You will need a single Octopus installation in order to do anything in Octopus, like push packages from TFS to it and run scripts from it. OctoPack itself doesn’t require a separate installation besides that. You can create a project with a deployment process in Octopus, in which you can run custom scripts that should be able to call AWS Code Pipeline to execute.

I hope this all helps!

Best regards,

Kenny

Hello Kenny,

Thanks again for your reply. And, apologies for any confusion created regarding my query request.

Anyways, when you say a single octopus installation is needed.
What are the steps involved for the Octopus Installation Process?
Can you share me the Installation Steps?
And is it free of cost?
Does Octopus require a separate machine for the installation?

Regarding the Octopus to Trigger AWS Codepipeline Flow. Yes, i have now understood that after the Octopus Installation, i can package my application in a Octopac which can be configured from my TFS Build Definition and then create a custom script to call the AWS CodePipeline API. Please correct me if i am wrong with my understanding.

Also wondering, if you have any steps handy for Octopus to Trigger AWS CodePipeline API as well?

Looking Forward. Thanks

Tarun

Hi Tarun,

That’s no problem at all! I just want to ensure I give you the best information to help.

Octopus doesn’t require a separate dedicated machine. You can install it to an existing machine. The installation process and system requirements are shown in our documentation as well.

You can sign up for a free 45 day trial to give it a try and see if it helps in your scenario. You can get that here.

Unfortunately we don’t have any built-in steps for triggering AWS Code Pipeline. Like you’ve correctly said, that would require a custom script from within a deployment step.

I hope this helps!

Warm regards,

Kenny

Thank you kenny, will get back to you for any further queries.

Tarun