The railway world is a fast-moving environment. To bring you the latest improvements and fixes as quick as possible, Captain Train’s web-app is often updated, sometimes several times per day.
Did you always wonder how we manage building and deploying all of this without a jolt? Then read-on: here is a technical peek into our engineering process.
We used to build our web-app using Jenkins. A robust and proven solution—which was polling our repositories every minute, and built the appropriate integration and production branches.
However we recently switched to a new system for building our web-app. To host our source-code and perform merge-requests, we’re using a self-hosted instance of GitLab. It’s nice, open-source—and features an integrated build system: GitLab-CI.
See it like Travis, but integrated: just add a custom
.gitlab-ci.yml file at the root of your repository, and GitLab will automatically start building your app in the way you specified.
Now what’s cool about this?
Jenkins builds were all executed on a resource-constrained server—and this made builds slow and unreliable. For instance, we observed several times PhantomJS crashing randomly during tests: apparently it didn’t like several builds running on the same machine at the same time—and a single PhantomJS process crashing would bring all of the others down.
So the first step of our migration was to insulate builds into Docker containers. In this way:
GitLab-CI allows us to add more runners very easily. And now that builds are performed in Docker containers, we don’t have to configure the runners specifically with our build tools: any out-of-the-box server will do.
Once a new runner is declared, scaling is automatic: the most available runner will be picked to start every new build. It’s so simple that you can even add your own machine to build locally.
We’ve already reduced our build time by switching to a more powerful runner—a migration that would have been more difficult to do using Jenkins. Although we regularly optimize the run time of our test suite, sometimes you also need to just throw more CPU at it.
With Jenkins, the configuration of the build job is stored in an external admin-restricted tool. You need the right credentials to edit the build configuration, and it’s not obvious how to do it.
Using GitLab-CI, the build jobs are determined solely from the
.gitlab-ci.yml file in the repository. This makes it really simple to edit, and you get all the niceties of your usual git work-flow: versioning, merge requests, and so on. You don’t need to ask permission to add CI to your project. Lowering the barrier to entry for CI is definitely a good thing for engineering quality and developer happiness.
GitLab-CI makes it really easy to build and test the branch of a merge request (or a “Pull request” in GitHub slang). Just a few lines added to our
.gitlab-ci.yml file, and we were running tests for every push to a merge request.
We get nice red-or-green-status, the quite useful “Merge automatically when the build succeeds” button—and, as branches are now tested before being merged, much less build breakage.
GitLab-CI provides “Pipelines”, an overview of all your build jobs. This points you quickly to a failing build, and the stage where the problem occurs. Plus it gets you this warm and fuzzy feeling of safeness when everything is green.
We found the overall experience quite positive. Once the initial hurdle of making the build pass in a Docker container, integrating it into GitLab-CI was really easy. And it gave us tons of positive signals, new features and neat integrations. 10/10, would build again.👍
Our Android team also migrated their pipeline, and are now building the integration and production Android APK with GitLab-CI.
After seven years of hard work, the project that started in my 12m2 apartment and is now Captain Train, has taken up an important place in the transport industry in Europe. It has been seven years of small lows and great highs, seven years of having fun getting up every morning to join a team of talented people who have a passion for simplifying your life, be it in with their code, their marketing campaigns or their answers to your questions.
The problem in this market is that goal we wish to achieve is gigantic and, in this context, any help is welcome. Trainline (which is like a Captain Train to our friends across the Channel), came to us last year and offered to join forces, and visions.
So, who is Trainline? Trainline, like Captain Train, an independent service to buy train tickets, located in the UK. Trainline launched in 1997 by selling train tickets by phone (hence, the train line), independently of the many carriers active there, and today processes more than €2.1 billion worth of train tickets each year in the UK.
So we merged, because we believe that together our strengths will enable us to develop faster to provide a simple and inclusive product to everyone travelling by train in Europe. The Captain Train team will provide their expert knowledge of the rail industry in continental Europe, and Trainline will give their significant experience in a very competitive and strongly growing market.
Does this mean that the Captain Train team will swap their baguettes for pints and move to London? Or worse, disappear? No. We will strive to create an unique product from our existing respective products, while remaining the same European company that we have always been. The new group will now have two offices, one in London and one in Paris. Both of these offices will continue to grow and develop.
Our ambition will remain the same. We want to provide everyone for everyone to all the trains and tickets in Europe, along with the all best prices, all available routes and itineraries and allow all rail operators to distribute their tickets effortlessly via a simple platform. So, we’ll be continuing on this track!
It has just been announced that there will be an SNCF strike, starting at 19:00 on Tuesday, the 8th of March and will continue until 08:00 on Thursday morning, the 10th of March. SNCF will be compensating strike affected travellers, by offering full refunds or the possibility to use the same ticket for another train.
To find out if your trip is affected by the strike and for more information on how to proceed, please have a look at the information we’ve provided below.
To find out whether your train is running and which other services are available, you can use SNCF’s real-time traffic website: www.sncf.com/en/timetables-updates-traffic
If your train isn’t running, please have a look below to find out what options and alternative travel plans are available.
TGV trains: In general, 1 out of 3 trains are running.
Intercités trains: On average, 3 out of 10 services are operating.
Intercités de nuit (night) trains): SNCF has cancelled all night train services during the strike period. So there will be no sleeper trains operating during this time.
TER trains: On average, 1 out of every 3 trains will be are running.
Certain Eurostar trains have also been affected by the strike. Eurostar has contacted all of their impacted customers and has made some changes to their timetable for the 9th of March. All customers have been re-accommodated on to alternative trains. Please have a look at Eurostar’s traffic information page for a more detailed overview of the revised schedule.
SNCF has reported that 5 out of 10 trains are running. You can check whether your train will be running on SNCF’s real-time traffic website: www.sncf.com/en/timetables-updates-traffic
If your train isn’t running, please have a look: below to find out what options and alternative travel plans are available.
It has been announced that 1 out of every 2 RENFE-SNCF trains will be running. We advise that you check SNCF’s real-time traffic website to see if your train will be running.: www.sncf.com/en/timetables-updates-traffic
If your train isn’t running, please have a look below to find out what options and alternative travel plans are available.
Traffic for all Thalys services have been reported as normal and on time. So far it looks like they will remain unaffected by the strike.
OUIGO has announced that 4 out of trains are still running. OUIGO will contact all customers directly that are affected and will inform you of an alternative timetable or possibilities for compensation. If you would like to check the status of your train, please have a look at www.ouigo.com.
iDTGV has not yet announced an alternative timetable. iDTGV will be contacting any of their affected customers directly with more details about your compensation and travel options. If your train is affected then you can either be refunded with a voucher or directly to your payment card.
If you wish to receive a refund to your payment card instead of the voucher, you must inform iDTGV of this (by replying to their email).
All SNCF tickets with departures during the strike period (from 19:00 March 8th until 08:10 March 10th), can be used for any other train (travelling the same route) without any additional charge. However, a seat is not guaranteed and instead you will need to find your own.
TGV and Intercités tickets:
You can take any train (travelling the same route) between the 8th of March until midnight March 10th.
Intercités de nuit (SNCF night trains):
SNCF does not recommend taking another night train with your existing ticket. This is because there is a risk that you may not find a seat or couchette and risk having to stand. Instead they recommend to take a train during the day, at any time between the 8th and 10th of March.
If you are booked to travel during the strike period and you wish to cancel or postpone your trip, please contact Captain Train and we will of course arrange a refund promptly. Though please do not cancel the tickets yourself under any circumstance. It is very important that we make the cancellation as otherwise the refund may fail.
As a reminder, this includes all tickets with travel scheduled between 19:00 Tuesday March 8th and 08:00 Thursday, March 10th.
If you have booked an OUIGO or iDTGV ticket, we cannot refund you directly. Instead have a look at the relevant section above to find out how iDTGV or OUIGO will refund you.
If you are scheduled to travel during the strike and wish to exchange your tickets to postpone your travel, please contact us and we will arrange a complete refund of your tickets. Please do not exchange the tickets yourself under any circumstance.
If you wish to exchange your tickets for another train during the strike period (i.e. from the 8th until 10th of March), please follow the instructions given in the section about compensation measures above.
Next Tuesday, SNCF will be holding a ticket sale for a huge number of beach destinations in France. So if you were thinking about visiting the French Riviera or Basque Coast this summer, you have one week to do some planning!
This sale will include tickets with departures from the 1st of July until 28th of August. As per usual, those who are earliest to book get their hands on the best tickets.
***Correction: January 28th
We had previously advertised that this sale would include RENFE-SNCF, TGV Lyria and TGV France-Italy tickets. These dates have now been changed and these tickets will be released on the 3rd of March instead.
In one week, you’ll be able to book your tickets to a large variety of destinations on the Mediterranean coast. The great thing is that you will also be able to book tickets between these destinations and not only just from Paris.
Here’s what you will be able to book:
The good news is that the tickets are not limited to departures/arrivals from Paris. So you can combine trips between any of these destinations as well. For example, you could book a ticket from Nice to Avignon, Toulon to Ventimiglia or Cannes to Antibes. There are plenty of options!
If you’re someone who prefers their beaches to have some bigger waves, then you can be glad your destination (if it’s in the south west of France) will also be included next Tuesday.
The following destinations will be covered:
Of course, you can again book tickets between any of these destinations as well. So that could include a train from Lourdes to Pau, Biarritz to Toulouse, or Agen to St Jean de Luz.
Many remaining destinations in France that are served by TGV and Intercités trains (including Bordeaux!) in France will go on sale on the 31st of March, for the upcoming summer. This will also include tickets for northern France (destinations towards Belgium).
This means that if your destination is not listed above, then your tickets will become available on March 31st and not in this upcoming sale.
As of the 3rd of March, you’ll also be able to get your hands on a range of tickets for journeys between France and Spain, Italy, and Switzerland. Specifically, it will include RENFE-SNCF tickets for trips between France and Spain, which that includes Paris – Barcelona, Perpignan, Girona and more. Plus TGV Lyria tickets for trips between France and Switzerland (e.g. Paris – Zurich or Geneva) and TGV France – Italy tickets, for trips between Paris and Milan
To see exactly which destinations are included, you can find some route maps by clicking here.
Since its beginning, Captain Train has been designed with speed in mind. It takes only three simple steps — search, book and pay — to get your train tickets. Yet it’s often the final step that causes the entire process to slow down and start lagging behind like an old steam engine.
It’s usually during checkout when things can get complicated. Suddenly you realise that in order to pay, you need to look for your wallet – knowing it’s not going to be where you think it is, remembering it’s in fact in the other coat, which you finally find downstairs in the other room and proceed to bring back to your computer, typing out the 16-digits, making an error with the last two, then realising it’s actually the wrong card, taking out the other one and entering its details, managing to get through the 3D Secure verification process on your second try – to finally confirming and receiving your tickets. In short, it can be painful for some.
To save yourself time in the future you can now save your card to your Captain Train account after completing a payment. And this will allow you to use that card across all of your devices. Picture it working like a memory foam mattress: we store your card so you can always come back to it in the most comfortable position and use it during checkout. There’s no need to get up and get your wallet. No need to enter your 16-digit card number. Simply type in your security code (the 3-digit CVV code on the back of your card) to confirm any of your future payments.
Once you link a credit card to your Captain Train account, you will be able to find it everywhere: whether you access your account through our website or our app. If you’re one of those people living in the future and have a phone capable of reading the impression left by the friction ridges of a human finger, then you can confirm your payments simply by using your fingerprint — without needing to enter a security code (CVV).
If you have an iPhone, you can use Touch ID to validate your payments. On Android, you can use Fingerprint for it. In both cases, the fingerprint validation replaces the need to enter your card’s security code (CVV). If your phone can’t read fingerprints, you can try asking it very nicely, or enter your security code for the payment confirmation, just like on our website.
You do not have to save your credit card. But if you wish to, we would like to repeat that we do not toy with security. The details of your credit card are not stored within the app (or anywhere) on your phone. So in case of loss or theft, your details will not be exposed. All of your precious payment data (card holder name, card number, expiry date) are stored securely in a dedicated vault, from which they can never ever get out. In other words, the system is designed to close the door behind your card, and that once you have decided to store it, it can enter but never leave.
We do not claim to be smarter than others. So if you have any questions or comments about the security of our system, you can get in touch with us and we will try to answer as best we can!
Good news never travels alone. So we’d like to take this opportunity to announce that we’ve expanded the range of tickets you can buy with PayPal and AMEX. Basically, you can now buy any ticket with any means of payment – as long as we accept those means in the first place. For example, Yu-Gi-Oh! cards are not an accepted means.
We began selling train tickets online in 2011. On our first day, we managed to sell a total of 6. Today, we sell thousands daily. So it suffices to say that things have changed in the meantime.
This article will reflect on the past year of 2015; a year that faced us with some tragic realities as a Parisian company. Rather than withdraw and keep it to ourselves, we’ve decided to share our year in numbers with you.
On top of this, we’re now able to prove to our parents that we have a real job, which is why we might not call so often, but doesn’t mean that we love you any less, mum.
*That’s 379336767.031 miles, dear Americans and Britons.
P.S. We really would like to thank you for using Captain Train in 2015! If you feel like it, you can send us an email, to with your postal address in France (sorry, we can’t ship internationally) and in several weeks you’ll receive a present. Only the postman will know your address, we’ll do nothing else with it. As our stock of presents isn’t infinite, we’re applying the scientifically proven theory of first come, first served. If you don’t receive anything, it sincerely does not mean we don’t love you. Promise. 4ever.