-3

I have a WAMP server which hosts a Django application by using a Windows server.

Currently I am deploying everything manually. Now I want apply Continuous Integration concepts to an existing application.

What approach should I follow and what technology should I use for this?

Which is better server to host Django application by CD in mind

 is it Puppet,

       Chef, 

       Jenkins etc

Currently I am using Git as source control.

  • What did you find? – 030 Sep 18 '17 at 14:31
  • can you please elaborate your question bit more – niran Sep 18 '17 at 14:33
  • What kind of CD's did you consider? – 030 Sep 18 '17 at 14:33
  • I have no idea where to start. I am using git, wamp, windows server – niran Sep 18 '17 at 14:35
  • 4
    I have voted to close this as primarily opinion based: there are multiple technologies for doing this and no single technology is the best or recommended way to implement this. The best one will be whatever you feel best meets your needs. – James Shewey Sep 18 '17 at 15:59
3

As you are already using Bitbucket, Bitbucket pipelines could be useful.

What languages are supported?

Node, Ruby, Python, PHP, and more. Anything you can run in a Docker container is supported.


why not jenkins?

Jenkins could be an option as well. If Bitbucket could trigger Jenkins or Jenkins could check whether there are code changes.

  • what is the difference b/w pipelines and Jenkins. which one easy to use – niran Sep 18 '17 at 16:20
3

I am in a similar pair of shoes as you - I am currently, slowly, getting into the DevOps topics after having many, many years of conventional development (and close connections to conventional ops) behind me.

You seem to have read a few articles, or heard a few things. That is good. Let me suggest a practical approach how to go on:

  1. Take your favourite application (which you or your team wrote yourself); not too large, preferably with a limited amount of services (like Apache, DB etc.) working together with your app.
  2. Install docker, read a bit on the Dockerfile and the whole build process, and just go ahead to create one or more Dockerfiles for that application. You know already how to deploy it manually; now make it run inside a container.
    • Make it easy on yourself. Use a FROMparent container that is a full-blown distribution of your choice. I like debian:jessie, but you can pick whichever you are familiar with.
    • At the start, do not worry about image sizes. This is just a pet project. Start your Dockerfile with the FROM, then as many apt-get update; apt-get install ... as you need to get your application running. Add stuff with ADD and COPYliberally.
  3. Learn how to actually run those containers; how EXPOSEworks, how to --linkthe app together with the DB and the Apache (in case you made a separate container for that - you can skip this obviously if your app is able to serve all stuff including static pages itself). Figure out how to mount/bind volumes, how to debug a container by opening a shell inside it and so on. docker-compose is nice if you have more than one, and pretty simple to get going with.
  4. Now you probably have a working setup. That's great! You have learned the basics, and you immediately feel the great power that comes from containerizing your app. You can deploy it instantly on any server, you can give it to your developer colleagues and go up and running in zero time, and so on. Enjoy that feeling for a while.
  5. Make the image smaller. There are a few obvious things you can do (google...), and a few not so obvious ones (thinking is like googling, just better... :) ). If you need help on that, post more questions here.
  6. Get Jenkins (feel free to do so with docker, again, if you're adventurous) and make a job to build the image from the Dockerfile and run your test suite directly in the container you built. Jenkins can check your repository for updates automatically, you don't need to bother with git hooks at this moment.
  7. You're done! This was the CI part. For CD, after the tests are green in Jenkins, simply tag the build and send it on to your deployment server.

This should take you, if you are an experienced developer and have done these things "dry" already, not much longer than a few days. Docker itself is a pretty simple affair, there is not much more to it. One further part that makes sense to add to the puzzle is Ansible, which makes it pretty easy to manage another machine remotely (i.e. for installing packages, deploying stuff, starting services and whatnot).

If you have Docker and Ansible down, just get your CI/CD pipeline to work. Google advanced, but necessary stuff like security and such. After that, you should be experienced enough to decide in which direction to go next (i.e., larger stuff like Openshift/Kubernetes, or just whatever AWS/Azure or whatever have to offer, etc.). There are a myriad of different options out there, and much of the choice seems to be pretty opinion-based. If you get into High Availability, swarms and such, it will also pretty soon get more non-trivial. But starting out with Docker should be fun and relatively straightforward.

  • This is awesome answer...I am using windows..not sure how it fits... but it has full picture that is required to start basic.. thanks a lot – niran Sep 20 '17 at 3:40
  • One more Q, if I follow above steps does it means that wamp is not required anymore – niran Sep 20 '17 at 3:44
2

You've chosen a fairly difficult stack to support. WAMP is largely used in dev environments, and the windows builds of mysql, php, and apache typically lag their Linux counterparts by a significant amount. You can likely reuse your code, barring any hard coded or absolute paths, on Linux. Once you move to Linux, there are lots of great deployment options, the most obvious of which is probably docker. Since your stack includes a full relational database solution, and a web server, you're up against a lot of potential complexity. This makes it near impossible to give you a good answer beyond scripting something via powershell and rolling your own if you want to keep this stack on windows. You can keep windows and swap your stack and switch languages (probably a terrible idea, depending on how far you are into this) or you can switch operating systems and keep your code, but potentially fight with a whole world of new OS frustrations. I recommend this path, but there's no solver bullet here.

So you have two pretty significant hurdles: 1. Get this app running on LAMP. 2. learn a deployment tool for LAMP.

Alternatively you might be able to find a specialized WAMP host who will let you do something like FTP your code to them, which you could script. That's not really a production-worthy plan if you ever intend to scale this application, but sometimes it's smart to act small.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.