Building our web-app on GitLab-CI

by Pierre de La Morinerie, posted 21 July 2016 | 3 comments

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.

GitLab at Captain Train

From Jenkins to GitLab-CI

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?

Reliable dockerized builds

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:

  • Every build is isolated from the others, and processes don’t crash each other randomly.
  • Building the same project on different architectures is easy, and that’s good news, because we need this to support multiple Debian versions.
  • Project maintainers have greater control on the setup of their build environment: no need to bother an admin when upgrading an SDK on the shared build machine.

It scales.

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.

Easier to control

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.

Tests on merge requests

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.

Still testing – but just hit the "Merge When Build Succeeds" button and move on

Still testing—but just hit the button and move on.

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.

Ready to merge.

Ready to merge.

A slick UI

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.

All Pipelines are green, ready to deploy.

All Pipelines are green, ready to deploy.

In a nutshell

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.

For further reading, you can find on the official website a nice overview of GitLab-CI features, and some examples of gitlab-ci.yml files.

Captain Train + Trainline

by Jean-Daniel Guyot, posted 15 March 2016 | 7 comments

blogpost_cttlAfter 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!

SNCF Strike March 2016

by Malin Schibler, posted 07 March 2016 | Add comment

screen capture of a Wes Anderson movie

Walking is one of the options

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.

Domestic SNCF trains

To find out whether your train is running and which other services are available, you can use SNCF’s real-time traffic website:

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.

Eurostar trains

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.

Lyria Trains

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:

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.:

If your train isn’t running, please have a look below to find out what options and alternative travel plans are available.

Thalys trains

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 trains

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

iDTGV trains

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).

 Compensation measures for affected travellers

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.

How to receive a refund

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.

How to exchange your tickets

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.

SNCF Summer Sales Start on February 2nd

by Malin Schibler, posted 28 January 2016 | 52 comments

Just a small selection of available destinations

Just a small selection of available destinations

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.

Head to the Mediterranean coast

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:

  • Paris – Avignon TGV
  • Paris – Aix en Provence
  • Paris – Marseille
  • Paris – Nice
  • Paris – Toulon
  • Paris – Hyères
  • Paris – Les Arcs Draguignan
  • Paris – Saint Raphaël Valescure
  • Paris – Cannes
  • Paris – Antibes
  • Paris – Monaco
  • Paris – Menton
  • Paris – Ventimiglia

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!

Visit the Basque Coast (minus Bordeaux)

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:

  • Paris – Agen
  • Paris – Montauban
  • Paris – Toulouse
  • Paris – Tarbes
  • Paris – Lourdes
  • Paris – Pau
  • Paris – Orthez
  • Paris – Dax
  • Paris – Bayonne
  • Paris – Biarritz
  • Paris – Saint Jean de Luz
  • Paris – Hendaye

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.

Is your destination not included?

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.

Want to Visit Switzerland, Spain or Italy?

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.

High-Speed Payments

by Malin Schibler, posted 21 January 2016 | Add comment

one click payment header image displaying two phones

It’s so fast that our camera’s frame rate can’t even handle the speed.

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.

The problem lies at checkout

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.

Store your card to pay faster


Your cards are saved in your Preferences, where you can modify or delete them.

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.

Linked across your devices

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).

one click payment iOS and Android comparison

Works on both iOS and Android

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.

Extra safety harness

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!

Pay for everything with anything

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.

A Look Back – 2015 in Numbers

by Malin Schibler, posted 19 January 2016 | 4 comments

infographic showing our growth from 2009 to 2016

The marketing department likes green graphs

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.

  • 2

    Trophies Collected

    One of which rewarded our collective talents in table football, which is a sport that conveniently lets us take up a position of defence without needing to break into a sweat.

  • 52

    Employees on board

    We’ve had many bright new faces join us on our quest for world domination. Equipped with WiFi and power sockets at every seat, our office might also have something to offer you, or someone you know.

  • 473

    Declarations of love on Twitter

    Your tweets have warmed our hearts and much, much more. You’re the reason why Captain Train keeps on growing. So we want to say a huge thank you for being such awesome customers and for helping us get this far.

  • 21 568

    Destinations Offered

    Every station in our booking engine was hand picked by Tristram, our very own data sommelier. As a company that firmly believes in open source data, we’ve tried to return the favour. So take a look at our stations data on Github.

  • 29 543

    Conversations with our customers

    More customers means more interactions. To continue to be there immediately if something goes wrong, our customer care team has expanded this year. As always, they’re waiting at their keyboards, ready to respond to your questions.

  • 1 330 534

    Captain Train Members

    2015 became the year of the million for us. We’re now only missing 3 out 8 Kardashians. If this were a population count, we’d be a bit smaller than Gabon and a bit larger than Estonia — which suits us just fine.

  • 10 116 132

    Ticket Searches

    The best holidays are the ones that you plan, which is apparently evidenced by your high volume of searches. Continue on like this, it keeps our servers fit and gives you the chance to combine a variety of (cheaper) international routes.

  • 610 483 350

    Kilometres Travelled*

    That’s the total distance covered by our customers in 2015. Which is just a bit more than two return trips to the sun.

*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.

Current travel information

by Mick Aberman, posted 14 November 2015 | 3 comments

Updated – 08:40 Tuesday November 17th

All domestic and international services are operating normally.

French borders are ​open with increased border checks. Please allow for additional time for international trains.


All services are running as per normal and security has been increased in stations and on trains.

Any passengers who were unable to travel over the weekend or who have a trip taking place before the 19th of November (and do not wish to travel), are eligible for a refund from SNCF. Please get in touch with us and we will take care of this for you.


All trains are running to all destinations, with increased security measures.

Thalys tickets to and from Paris for trips taking place before the 17th of Nov. can be refunded by Captain Train. Please contact us by email.   Trips taking place before the 22nd of Nov. can be exchanged directly by calling the following number: +33 8 92 35 35 35 


All services running normally. Eurostar advises all customers to allow 60 minutes for check-in and to regularly check Tickets can be exchanged for free (within 60 days) if you are travelling today, by contacting Eurostar directly at 03432 186186 (UK). No refunds are possible.  


All trains running. No refunds are currently planned.

DB Bahn

Normal traffic.

Trips to and from Paris taking place before November 21st are refundable without fees. Please contact DB directly at +49 (0)1806 101 111 or by email at Do not cancel your DB tickets on our website.  


Disneyland Paris is closed today in solidarity with the victims.

For more information on the traffic status of the Parisian metro, bus and local trains, please see the RATP’s website.



Captain Train

We can be reached by email and on Twitter.

Our thoughts are with the families and friends of the victims.