

Deploying a third-party Rails application - like Gitlab
source link: https://www.devroom.io/2011/11/18/deploying-a-third-party-rails-application-like-gitlab/?utm_campaign=Feed%3A+ariejan+%28ariejan%7Cdevroom.io%29
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Deploying a third-party Rails application - like Gitlab
Posted:
2011-11-18
- Last updated:
2019-06-05
Tagged capistrano github gitlab deploy
We all know how to deploy our own Rails projects. (If not, read this guide.) But how do you handle deploying a third-party application that may require some customisation on your part?
A good example would be Gitlab
Gitlab is an open source Github clone, build using Ruby on Rails. It’s a nice project that uses Gitosis under the hood to manage your git repositories. There are several good installation guides available on the web, but they all assume you want to deploy gitlab verbatim - without any modification or configuration
I have also setup Gitlab, but I want to use capistrano and unicorn. I also want to tweak some configuration. In some rare cases I want to fix an annoying bug and not wait for the Gitlab team to pull it.
Doing a git pull
on my remote server just won’t cut it.
Fork! Fork!
What I did was clone Gitlab and use the same principles describe in my Contributing to open source with Github to apply my own changes and merge any upstream changes when they are available.
Here’s how I set everything up.
First, clone the official Gitlab repository and name it upstream
.
git clone --origin upstream https://github.com/gitlabhq/gitlabhq.git my_git_server
Next I made all the changes I want. I updated config/gitosis.yml
and unicorn
to Gemfile
and setup Capistrano.
I then pushed this to my own git server. This is the same server Capistrano will use to pull changes from.
git remote add origin [email protected]:my_git_server.git
git push origin master
cap deploy
That’s all there is to deploying Gitlab from my own repository.
Merging upstream changes
Now, the Gitlab crew is pushing out new features at an amazing rate. So, how do I get those new features (and the occasional bug fix) into my copy of Gitlab for deploying?
git fetch upstream
Remember how we named the official Gitlab repository upstream
earlier? With this fetch
we get all changes from their repository (but we don’t apply them to anything yet).
Then, merge the upstream changes with your own branch.
git merge upstream/master
There may be merge conflicts, just resolve them and commit your merge. Then again to deploy:
git push origin master
cap deploy
Why do this?
The reason I use this approach is that it’s easy to merge upstream changes and have my own customizations and deployment tools at the same time.
Recommend
-
87
How the web ecosystem is preventing us from reverting the third-party cookie mistake.
-
15
Deploying to HatchBox with Rails 5.x Sep 14, 2020 I just got a database less home page for a future SAAS app deploye...
-
32
Deploying a Static Website on AWS Web Hosting with GitLab CI March 03, 2020 ...
-
9
This blog post is a quickie where I document how I deployed CovidNearMe onto Google Cloud Platform or GCP using HatchBox.io. I need to start by giving a huge shout out to Tony Carnevale...
-
10
AWS Tutorial 09 - Deploying Rails Apps With Capistrano Take 1 Sep 23, 2016 In this tutorial we're going to use the latest version of Capistrano to deploy your Rails app onto one or more EC2 instances. I'm dividing this...
-
8
Deploying Rails to AWS LambdaServerless computing helps offload the work of managing and provisioning servers to a cloud provider and is rapidly becoming a thing for most technology teams. AWS Lambda is a type of serverless technology used by...
-
7
Mitigating the variability of third party services like S3Dhruv SringariApril 25, 2022TECHNICAL6 min readEv...
-
4
Deploying Rails with Docker and AWS Fargate In this tutorial, you'll learn how to deploy a dockerized Ruby on Rails 7 app on Amazon's Elastic Cloud using Fargate. We will learn what Fargate is and how it makes...
-
4
Handling third-party webhooks with Rails Event Store Hi, weʼre arkency 👋 Lately, one of our clients asked...
-
8
Rashmi Joshi August 18, 2023 3 minute read
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK