Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use AWS CodePipeline with Lightsail?

I'm working all the day and couldn't find the answer. So I'm asking you guys: is it possible to use AWS Pipeline with AWS Lightsail?

My objective is to store the code inside CodeCommit and use CodeBuild, CodeDeploy, CodePipeline and S3 to create a Continuous Deployment inside a Lightsail instance.

Those are the steps I think I have to follow to accomplish the task:

[x] setup a Lightsail instance
[x] create an IAM user and set permissions
[x] transfer my repository to CodeCommit
[x] create an S3 bucket to hold the build artifacts
[x] create a CodeBuild project to build the artifacts
[x] create a buildspec.yml file with my build steps
[ ] create a CodeDeploy project to deploy my application
[ ] create a CodePipeline project to trigger the build when I commit to certain branch

As you can see, I'm almost there. But I couldn't find any way to use my Lightsail instance with CodeDeploy. So, my question is: is it possible? Is there some limitation? Did I miss something really basic? Is there any other way to make the CD with Lighsail? Sorry, I'm getting a little crazy right here ahhaha.

like image 608
Kleber Avatar asked Aug 14 '17 20:08

Kleber


3 Answers

Today, 08/16/2017, it's not possible to integrate them.

I asked the same question on AWS forums and they replied that those technologies are not integrated yet since they are separated from each other.

Well I guess I'll have to find another way.

like image 180
Kleber Avatar answered Nov 15 '22 16:11

Kleber


i’m not a total expert here, but I think the way to do it would be with a custom script in CodeBuild, rather than with CodeDeploy.

CodeDeploy has a lot of custom stuff going on to support rollbacks and that sorr of advanced stuff (means you have to install the agent on your target server etc).

CodeBuild is just made for running scripts, so I think it’d be reasonable to add a deploy script (that runs after your tests) that connects up to yor Lightsail instance via SSH and deploy any changed files (similar to how you’d do it in open source using Travis CI etc).

Specifically I’ve used the dploy package on npm to do the actual SFTP upload before. It’s Git-aware so it only uploads changes since the last revision (but you could just rsync if you didn’t care about that).

like image 23
Dave Houlbrooke Avatar answered Nov 15 '22 15:11

Dave Houlbrooke


I recently had the same challenge and got it working.

It is necessary to register the Lightsail Instance as an on-premise instance with CodeDeploy. On the instance itself the CodeDeploy agent needs to be installed and configured.

I have written a post about how to set this up on my blog.

like image 42
Jens Eickmeyer Avatar answered Nov 15 '22 16:11

Jens Eickmeyer