Standardizing interfaces across projects with Makefiles

by Pierre de La Morinerie, posted 30 September 2016 | Add comment

If you are working on a non-trivial software solution, you probably have several projects. Maybe one for the frontend, and one for the backend? Maybe one for managing data, or secrets, or deployment? Or did you drink the micro-services kool-aid (please don’t), and have now dozen of projects, each one containing a small server?

In this case, the README file for these projects probably have a common structure (“How to setup”, “How to run”, “How to test”) – but all of them will contain different invocations. Sometime the project needs to be started with npm run, or node server.js, or ember server – and some other project with bundle exec rails server, or maybe ./bin/server.

What if we could instead express standard shortcuts for all these commands?

That’s what Unix project maintainers have been doing for ages – and also what we eventually did with Captain Train projects: we used Makefiles.

Read more »

Captain Train changes its name and becomes Trainline

by Malin Schibler, posted 06 September 2016 | 22 comments

Alea iacta gare de l’Est. The die is cast – our old name too. After many years of good and loyal service, we brought out old name to the depot station, in order to replace it with that of Trainline, as we announced a short few weeks ago. Since the acquisition of Captain Train by Trainline in March, both of our teams have been working closely together on a joint booking platform for Europe. To ensure that everyone finds their way around, it only made sense to have the same name and the same visual identity throughout all of Europe.

A new name and new colours

On our website:

search_en_shrink Our website is now accessible at We’ve changed the logo and the colour schemes, though the interface and the product remains exactly the same. You still won’t find any ads or booking fees.

In our apps:

Screenshots of our mobile apps Our Android and iOS apps have also received a new paint job, in order to adapt to Trainline’s colour palette and logo. Though the functionality remains exactly the same. In the App Store and in the Play Store we’re now called Trainline EU. This helps us distinguish ourselves from the British app, which is called Trainline UK (and is for train tickets in the U.K.).

On social media:

While we were already at it, we also changed our name everywhere online. You can now get in touch with us at , @trainline_eu on Twitter, and Trainline Europe on Facebook. Feel free to come by and say hello!

A future with prospect

In time, our website and apps will merge with the services of Trainline, to offer a single and comprehensive booking platform for all trains in Europe. Whether your departing from Manchester, Dyffryn Ardudwy, Dijon, Barcelona or Rome, you’ll have all of your tickets in the same app. There’s still a long road ahead, though we’re at least now working towards our goal whilst sporting the same colours. Thank you to everyone who has been using Captain Train, especially our loyal customers. With all of our heart do we want to make this collaboration with Trainline successful for you.

What to Expect in September

by Brice Boulesteix, posted 22 August 2016 | 8 comments

We wanted to give you some news and let you know what we’ve been up to in the months following the Trainline acquisition last March. In brief, the past five months have been five very good months for Captain Train: our sales have rocketed, our European network has expanded and the Trainline team has warmly welcomed us each time we’ve visited them in London—although the same can’t really be said about the weather.

What we’ve accomplished

In France

picture of captain train team in the metro In the Hexagon, we hung our posters up in the Parisian metro and train stations for a few weeks.  As you can see, we were pretty excited about that.

In Europe

map of spain with railway network In Europe, Spain has joined the list of countries where we sell all types of train tickets. Like France, Italy and Germany, our site and applications are now practical for every day living in Spain. Spain’s network is very similar to France since only one carrier operates the trains there: Renfe.

What remains to be done

Becoming Trainline

Since the takeover by Trainline, the Captain Train managers have been leading a double life and juggling two business cards at a time: some with the Captain Train logo, others with the Trainline logo. To lighten their pockets, as well as establish one single brand across Europe, we’ve decided to adopt the name Trainline. From September on, Captain Train will be known as Trainline. Our site and our application will change name and colour, but soon you will see that Captain Train is just getting a mint green paint job. We have no plans to move a single pixel, it’s just a simple coat of paint, so that the appearance of Trainline services are the same on both sides of the Channel.

Don’t lose touch

We are now part of the group Trainline, certainly, but our mission and our values have not changed. We will continue our efforts to become the favourite site of people throughout Europe who wish to purchase train tickets. Clearly, everything at the heart of Captain Train remains more relevant than ever with Trainline. Trainline wants to simplify ticket sales like us. They are eager to promote train travel and, like us, they want to conquer Europe—in the geographical sense, anyway.

Moving forward

A new chapter has opened for Captain Train. Trainline is now part of our daily life and we’re still doing what we always wanted to do: become the largest window to Europe. Thanks for reading. If you have any questions or comments, we’d like to hear them, so leave us a note below or send an email to

Building our web-app on GitLab-CI

by Pierre de La Morinerie, posted 21 July 2016 | 2 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.