Is there a way to publish a website from github or cloud9IDE directly to a web-host? - github

Is there a way deploy a website directly from github or cloud9 ide? using ftp or other way, right now it doesn't matter what hosting, just so it'll be fully functional and accessible online.
(I know github has a web-hosting of a kind but it seems very limited)

What webframework/language are you using? If you use RoR or Sinatra or any other rake-based framework you can use heroku.com. If your using asp.net you can use appharbor.com, finally if your using php you can use phpfog.com.
What these hostingproviders have in common is that you deploy the website by pushing your code with git, while you won't be deploying directly from github you can just add one of the above mentioned hosts to your remote-list (in addition to github) and then push to that remote when you wish to deploy.
Another solution would be to add a post-receive-hook to github which then triggers whenever you push to github, in that post-recieve-hook you could tell the webhost to pull from the repo. This does however require you to have git installed on the webserver aswell as some kind of webinterface for the post-recieve-hook to post to.

Related

Automatically mirroring a Gitlab repo onto Github on push

I'm looking for a way to automatically mirror my Gitlab repos to Github, on push. I use Gitlab repos as my main repos, and would rather have to push to only one remote. But, I want my code to be browsable on Github also.
I found similar questions on StackOverflow, such as this one.
But the answers are always the same: one should add a custom post-receive git hook to the gitlab repo. This requires a shell access to the server running Gitlab. As I'm hosting a community edition Gitlab for many users, and not only me, they can't have easy access to a shell (and this isn't the most user-friendly way to do this), so it does not fit my needs.
I thought about two ways to implement it:
Either a MirrorOnPush project service, implementing such a git hook in Ruby, as the EmailOnPush project service currently do.
Or use a custom server to clone and push the repo, using a webhook.
The first one seems to be the cleaner to me, but I can't find any doc about Gitlab project service and code structure… On the other hand, the second is a bad and ugly hack, but is almost straightforward.
I'd rather implement a project service to handle it. Do you have any doc or leads on how to write a project service for Gitlab (without having to read all the Gitlab source code, as there seems to be no dev doc…) ?
Thanks !
one should add a custom post-receive git hook to the gitlab repo.
Actually, that was the best solution, up until 7.x GitLab, as I detailed in "Gitlab repository mirroring";
A true project service for repo mirroring is requested, but not voted up enough: suggestion: suggestion 4614663.
The main documentations remains:
the app models project services folder,
the spec models project services folder,
the doc/project_services,
the project services scenarios.
This isn't much, as the OP noted before.
Since it That leaves you with the hack approach.

How to automate sync between a Github repository and Openshift?

What is the best way to automate syn between Github repository and Openshift ?
I found this documentation in openshift : https://www.openshift.com/forums/openshift/how-to-keep-a-github-repository-and-an-openshift-repository-in-sync For manually doing a syncrhonisation.
I guess the first question is why you want to automate it? What do you want to achieve? In many cases a manual push to Openshift and GitHub might be preferable.
However, let's explore some possibilities:
Configure a git remote with multiple urls and then just git push all. See also Able to push to all git remotes with the one command?
Use a GitHub Webhook - https://developer.github.com/webhooks/creating/. GutHub will then send a HTTP request to a given URL on each push. You can then setup something on your openshift gear which listens to the request and if it receives one pulls from GitHub. you might then need to restart the app via ctl_app (see https://www.openshift.com/kb/kb-e1055-how-to-restart-an-application)
Last but not least, you could make use of the .openshift/action_hooks/post_deploy deploy hook in OpenShift. I gets triggered after redeploy of your application. In there you should be able to the repo to GitHub as well.
Which approach makes most sense will depend on your use case.

Setting up Git before pushing my project live

I am making a small web project which I am doing on the LAMP stack using the Symfony 1.4 MVC framework. I am interested in documenting everything, right from the database to the code and I want to push all my code onto GitHub. I know how to setup a repository on GitHub and push changes etc live.
What I am unable to wrap around my head is this:
I have the development server, which after testing it out I push it onto my GitHub repository, after this I want to naturally have to push it onto my production server. Typically, this being a one man project, I can easily push the project live to my production server using rsync. And this is how I would typically configure it in my YAML files and then symfony will automatically push the changes to my production server.
Naturally, I want GitHub as the intermediary where the code to my project is saved and from there I should be able to deploy it to my production server.
But how exactly I should achieve this, I have no clue.
Can anybody suggest the missing pieces to this puzzle?
You can use Capifony to deploy your symfony project.

Organizing workflow with Mercurial and Netbeans (+ bitbucket.org?)

I've never worked with any version control systems before. Now I'm trying to learn Mercurial, but I'm confused (I've already read about 10-15 articles + hginit.com). I don't know how to organize the workflow.
I have a testing server and a production server. I work from my office computer and from my home laptop. I make changes directly on the testing server, and every week or so copy new code to my production server. I also need wiki/issues/etc. pretty much everything bitbucket.org has. I know that's a bad way of doing things.
Is there any tutorial or articles on how to organize the workflow? I'd also appreciate any schemes/sketches describing the process.
Thank you!
[Edit: Changed based on comments]
Using Bitbucket
Once you have created an account.
You should be able to create a repo with an appropriate url. Then you can clone it to create a local repository.
Check out getting started.
See the following to push the updates to BitBucket.
BitBucket comes with very extensive documentation.
Also there are, other useful tools to work with BitBucket:
BitbucketExtension that allows you to use command line for a number of operations.
Using Mercurial Queues and bitbucket.org
Organizing workflow
You will have to evolve a workflow that suits you. In your case, it looks like you have a testing server and production server.
So , you can setup two repositories, one for the testing server ad one for production. You can make push to testing server automatic so that you can test out the changes immediately. You can tag releases that are then pushed to production server.
Your local repo can be used to publish changes to testing server.
You can push the approved changes, tagged to BitBucket repository.

How do I setup a version control repository on a web hosting account?

I'd like to work on my own projects on different computers...on the road on a laptop, or at home on the desktop, or even at work. I'd like to keep the data relatively private, and I don't want to pay for private repositories on github.
Ideally, I'd host a git or svn repository on my web host, or something like that. Can I do that? Or is there a web services-based version control system out there that accomplishes the same thing?
I use beanstalk for my development (svn). You could also try github (git obviously).
I use beanstalk as well for about 2 months now, I'm very happy with it, it also has integration to lighthouse so I can close bugs/issues with commit to SVN.
I also have a local VPS server hosted and I installed the VisualSvn Server on it, it works great but it's a bit on the expensive side.
My hosting provider, Dreamhost, provides Subversion repositories (along with Trac). However, if you can install a repository depends mostly on your hosting provider and what features they allow. Some make it easy, others won't allow you to install what you need to even set one up.