Where to put jenkins server in my situation - php

Hi i have a server setup like this ,
i want to update my QA server and Development server when ever a change happen to bitbucket . to automate this one person suggested me to use git hooks so i search about it and found about jenkins and bitbucket connector
jenkins hook management
so i think that i have to have a jenkins server somewhere and i can not figure out where .
where should i have a jenkins server . Inside Development server ? QA server ? or both servers ?
Can anyone please help me and explain how to do this because i am new to jenkins and bitbucket
I using PHP and my servers using LAMP

For what is worth, here is answer but not spectacular since there is no need to be spectacular :) You can set it up either on Development Server or QA Server it does not matter I guess.
Jenkins will orchestrate deployment from bitbucket to your environments and you just need one instance of it to do it. Flow will go something like this:
Push to bitbucket
Triggers commit hook
Jenkins remotes and runs deployment script on development server
Jenkins remotes and runs deployment script on QA server
Jenkins runs tests on QA server
etc.
Hope it helps, just to clarify deployment script here would be pull code, migrate db, restart server ...

Related

How to deploy a php web app behind firewall?

Does anyone know a solution for deploying a PHP webapp behind a firewall on mainly Windows servers? We have 100+ customers who host our webapp on premise, and we would like to setup a deployer, as a part of our bitbucket pipeline, so our code gets deployed on all installations.
1 customer = 1 installation aka deployment
Today we use a small PHP script, and some version control software, to pull code changes once every day. It runs on both Linux and Windows servers.
Hit me with any solutions :)
You can make use of PHPDeployer.
You can setup SSH-access on the servers and then configure the script to deploy to the desired IP of the server.

Use behat with jenkins in amazon ec2 server

How can I setup and configure behat,ahoy,docker with jenkins in amazon ec2 server?
I want to run my behat feature's every time I push something in my Git A/c with help of jenkins and sauce labs in the ec2 server.
There are lots of ways to do this. What do you know about Amazon EC2? And Selenium? And Docker? There are lot's of technologies here... Do you want to configure a Selenium grid? I'll try to answer some of this. But you are asking so many things... xD
I'll tell you my solution (Selenium grid) on that first:
First of all you need to create a Selenium hub with an EC2 ubuntu 14.04 AMI without UI and link it as a jenkins slave to your Jenkins master. Or as directly a master. What you want. Only command line. Download Selenium Server standalone. (be careful on downloading the version. If you Download the Selenium3Beta, things could change). Here you can configure the HUB. You can also add the Selenium Hub as a service and configure to run automatically at server start. its important that you open the Selenium default port (or the one that you configured) so the nodes can connect to it. You can do that on the Amazon EC2 console when you have created your instance. You just need to add a security group with an inbound rule for TCP in the port you want for the IPs you want.
Then, you can create a Windows server 2012 instance server (for example, that's what I did), and do the same process. Download the same version for Selenium and the chromedriver (there is no need to download any firefoxdriver for Selenium versions before Selenium3). Generate a txt file and prepare the Selenium command to link to the HUB as a NODE. And convert it to *.bat in order to execute it. If you want to run the bat at start you can create a service with the task scheduler or use NSSM (https://nssm.cc/). Don't forget to add the rules to the security groups for this machine too!
You can link as many servers as you want to your node.
If you want to use docker, good luck! ;) Haha.
No, with docker I recommend you to start as easy as posible trying to create a Dockerfile in local that runs the Jenkins server and the Selenium Server NOT in grid mode. When you have it working in local, push it to a repository. When You have all of this running, create an EC2 instance and install docker. Pull your selenium docker image and run it linking the local server ports to the docker machine ports.
You have so many work to do here... But it's so interesting. I recommend you go step by step creating in every iteration a better infrastructure. Don't try to add all that technologies at the same time.
Thera are lots of webs talking about that concepts.
Good luck!

Architecture of PHP based Production environment for push notifications on iOS

I'm ready to move my app and push notification platform into production soon, I have two .php scripts that need to be running the whole time (one checking for notifications to be sent and making the payload, the other opening a connection to Apple's push notification service and sending.
I've never run anything like this in prod, in dev I just used terminal to execute the .php, and mamp for the web server (php web API), so my question is how should I run this in prod? Is this style ok, ie. just running .php in the terminal and sticking with MAMP, or do I need to implement this differently?
As outlined above is how i'm now running prod, with nagios on linode.

Team development with node.js on a shared dev environment

How does one do team development with node.js when all the developers develop on the same dev machine?
Right now the dev server setup has nginx and apache. Developers SSH into the dev server and they have their own subdomained sandboxes to work on (database is shared). They hack their code and they check into the SVN repo. Great, works fine....until we started using node.js.
It seems node is not like apache or nginx where there's an independent server that serves up code. In node, the server AND the app code is tied together, so what happens is each developer will need to start and stop the server when changes are made. This creates a problem if one instance is started, it blocks the port for other developers.
I'm also having trouble figuring out how to put the node code into the same SVN repository as the PHP app code.
A friend told me the developers can do "timesharing" where the node code can only be modified by someone in a specific timeframe. Not sure if this process is scalable.
Another option is to have everyone work locally off their computer with a VM copy of the dev server so they can develop independent of the dev server. This requires a lot of infrastructure change and I'm not ready to do that yet.
Any suggestions on how to do this with the current shared dev environment setup?
Also, the reason why we are using node.js is to have good comet support. But if this is becoming a blockage to our current infrastructure, I'm willing to try other technologies and servers that is similar to how nginx or apache works--so that it is independent of the app code and can be compatible with our current development environment.
PS. I tried the nginx http push module. It's not well-maintained and not many updates. Scared to use it in production.
You could have each developer's instance of Node.JS running on a different port.

Synchronize local server and production server

I am doing a PHP project which is almost completed and uploaded to Production server for Client demo. Since The client is specifying some changes. I am doing that changes in my local server and later upload it to production server. Since some changes will took in more that 1 files its really difficult me to update the Production server via FTP.
Is there any way to Synchronize the changes made in local server with production server??
Is there any way to configure SVN in production server???
please help
Any help will be highly appreciated.
Thanks
well i think that you have your own answer... SVN... what you need is a SVN server.. (maybe in the same Production server or not), and if you have ssh access to your production server all you need to do is login in a console and update the new version.. for that you'd have to learn the basic svn commands, so you wont override configuration files or upload/download files you dont need (like uploaded images, etc)...
good luck!
Can't you do a 'checkout' of your project to the server? I think that would be the simplest thing to do.
When you change something in your system you just commit and then update in the production server. Either that or do a scp or rsync.

Categories