<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Julien Bianchi on Medium]]></title>
        <description><![CDATA[Stories by Julien Bianchi on Medium]]></description>
        <link>https://medium.com/@jubianchi?source=rss-b39129716c82------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*rVldMx7k8GKb8jEY.png</url>
            <title>Stories by Julien Bianchi on Medium</title>
            <link>https://medium.com/@jubianchi?source=rss-b39129716c82------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 07:12:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jubianchi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Mac OSX, git and GPG 2]]></title>
            <link>https://medium.com/jubianchi-fr/mac-osx-and-gpg2-d5f719fc596?source=rss-b39129716c82------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5f719fc596</guid>
            <category><![CDATA[os-x]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[gpg]]></category>
            <dc:creator><![CDATA[Julien Bianchi]]></dc:creator>
            <pubDate>Fri, 07 Oct 2016 12:38:54 GMT</pubDate>
            <atom:updated>2016-10-11T10:02:01.150Z</atom:updated>
            <content:encoded><![CDATA[<h4>Updating your toolset without breaking Git</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*EASrLhpgbG_6CisOj2zc0A.png" /></figure><p>If you recently updated you OSX environment, either by updating to Sierra or by only running the good old brew update &amp;&amp; brew upgrade, you probably ran into troubles when signing your git commits:</p><p>Here is an example error message you might have seen:</p><blockquote>error: cannot run gpg: No such file or directory<br>error: gpg failed to sign the data<br>fatal: failed to write commit object</blockquote><p>Or another:</p><blockquote>You need a passphrase to unlock the secret key for<br>user: “Julien Bianchi &lt;<a href="/service/mailto:contact@jubianchi.fr">nyan@cat.</a>yolo&gt;”<br>2048-bit RSA key, ID 2AA9E390, created 2016–06–22</blockquote><blockquote>error: gpg failed to sign the data<br>fatal: failed to write commit object</blockquote><p>The first one says that git is not able to find the GPG binary. In fact, updating your toolset via Homebrew might have installed GPG 2.0 and updated the GPG 1.4 binary, renaming it to gpg1.</p><p>The second error message is different: here git is trying to tell us there is a problem with GPG 2.0 (it’s now the default version linked to the gpg binary) making it unable to ask you your passphrase.</p><p>In both case, here is a quick fix that you can apply: git config --global gpg.program gpg1</p><p>Everything should now work fine!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5f719fc596" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jubianchi-fr/mac-osx-and-gpg2-d5f719fc596">Mac OSX, git and GPG 2</a> was originally published in <a href="https://medium.com/jubianchi-fr">jubianchi.fr</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Preview your website with Gitlab CI and Surge]]></title>
            <link>https://medium.com/jubianchi-fr/preview-your-website-with-gitlab-ci-and-surge-5b861d7c9a3a?source=rss-b39129716c82------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b861d7c9a3a</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[gitlab]]></category>
            <dc:creator><![CDATA[Julien Bianchi]]></dc:creator>
            <pubDate>Fri, 22 Apr 2016 21:14:03 GMT</pubDate>
            <atom:updated>2016-04-22T22:40:20.222Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi there!</p><p>To celebrate my first post on Medium I will be innovating a bit:</p><ul><li>I usually write exclusively in French but this time is over,</li><li>I’m mainly a backend developer but today we’ll talk about frontend,</li><li>You probably found me on Github but we’ll talk about Gitlab here.</li></ul><p>So, let’s start!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*hktVbrgHZm0JToBxF3Pr1A.png" /></figure><p>Some time ago I started a tiny pet-project called <a href="http://jubianchi.gitlab.io/gitlab-ci-wall/">GitLab CI Wall</a> which is <strong>a single page application</strong> written with Javascript and Angular. It has <strong>no backend</strong>. This project lets GitLab users have a clear and global view of their projects’ build statuses.</p><p>The stable version of this application is hosted on <a href="http://doc.gitlab.com/ee/pages/README.html"><strong>GitLab Pages</strong></a> (which is really good by the way) and I wanted to provide contributors with <strong>a simple way of deploying previews</strong> of their branches when they open a merge request on the main repository.</p><p>GitLab Pages does not allow us to deploy multiple version of the same project at the same time. You can only have a single version running which is OK but I had to find another way to do that. I started looking at <a href="https://teatro.io/"><strong>Teatro.io</strong></a> and <a href="https://www.heroku.com/"><strong>Heroku</strong></a> but it did not work or was <strong>too complex to host a simple SPA</strong>.</p><p>Then I remembered a service my friend <a href="https://medium.com/u/aad42d8c689f">Riad Benguella</a> introduced me: basically, it’s a static website hosting provider. Perfect! exactly what I need. I just have to host plain HTML/CSS and JS files.</p><p>This service is called <a href="http://surge.sh/"><strong>Surge.sh</strong></a>, it’s <strong>free</strong> and comes with <strong>super simple tools to ship your static content</strong>. Let’s see how I built this into my Gitlab CI pipeline and provide simple previews for any merge requests.</p><h4>Get started with Surge.sh</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*Sdgjxhw47vCcWovWDvKciA.png" /></figure><p>To get started with Surge.sh, you will have to install a tiny node module on your local machine which is the CLI to interact with the platform. It’s as simple as running this command:</p><pre>npm install -g surge</pre><p>In my case, my project is powered by node and npm so I ran:</p><pre>npm install --save-dev surge</pre><p>I’m not a big fan of globally installed modules so I would advise to <strong>try to always install the tool locally</strong>.</p><p>Once you are done with installing the CLI, just login to the platform:</p><pre>node_modules/.bin/surge login</pre><p>If you already have an account, just sign-in. If you don’t, you’ll be able to <strong>sign-up directly from the CLI</strong>.<strong> It should take about ten seconds</strong> and you will be ready to ship!</p><h4>Configure GitLab CI</h4><p>The next part will be to <strong>add the required job to your GitLab CI pipeline</strong>. This is another simple step. Open up your “.gitlab-ci.yml” file and add these lines:</p><pre><strong>preview:<br>  stage: </strong>deploy<br>  <strong>script:<br></strong>    - npm install<br>    - npm run build<br>    - SLUG=$(echo ${CI_BUILD_REF_NAME} | sed &#39;s/[^a-zA-Z0-9\-_]/-/g ; s/-\+/-/g&#39;)<br>    - node_modules/.bin/surge public my-awesome-project-${SLUG}.surge.sh<br>  <strong>except:<br>    </strong>- master</pre><p>So what are we doing here? Let’s see what each line does:</p><ul><li>We create a new job named “preview”,</li><li>We put this job in the “deploy” stage,</li><li>In its script, we start by installing the project’s dependencies,</li><li>We then build it using a NPM script named “build” declared in the projects “package.json” file,</li><li>We compute a slug based on the branch name: to keep it simple I removed every non alphanumeric, dash or underscore characters</li><li>We use Surge.sh CLI to ship the application, the first parameter being the directory to host and the second, the domain name to reach the preview application,</li><li>We specify that this job should be run on all branch except the “master”.</li></ul><p>Done! We are ready to ship preview applications! <strong>2 commands and less than 10 lines of YAML</strong>. Awesome!</p><p>Before going further let’s talk about this “SLUG” thing. I took the branch name, stripped some characters from it and used this value to generate a domain name for surge. Why? Because I want to have <strong>as many preview as I have open merge requests</strong>. Using the source branch name as a modifier in the domain name seems good enough as long as branches are named correctly. Moreover, using branch names will allow <strong>recycling domains</strong> and <strong>any push on a branch will update the preview</strong> for this branch instead of creating a new one each time something reaches the repository.</p><p>If you apply those changes in a branch of your repository, push it and look at the build you will see it fail: Surge CLI will not know how to authenticate on the platform. Let’s see how we can fix it.</p><h4>Configure your GitLab project</h4><p>To deploy your application <strong>Surge.sh requires you to be authenticated</strong>. It’s easy when your run the command in an interactive terminal session but in a CI build you can’t type in your username and password.</p><p>As every well designed interactive CLI tool, surge allows you to define some <strong>environment variables</strong> with your credentials and GitLab, which is also a very well designed piece of software, allows you to configure <strong>secured environment variable per project</strong>: go to your projects settings, open the “Variables” tab and create two variables: “SURGE_LOGIN” and “SURGE_TOKEN”.</p><p>Assign your username to the first one, the one you used when you signed-up. It should be your email address.</p><p>The token will be a bit harder to find. Remember when we first launched the “surge login” command? When we did it, surge automatically created (or wrote to) a file named “.netrc” in your home directory. Your token is there, get it from the file:</p><pre>cat ~/.netrc | grep -A2 surge.sh</pre><p>Take your token and assign it to the “SURGE_TOKEN” variable. Once done, save the variables. You can now either push your branch (if it’s not already done) or simply restart your failed build.</p><h4>Enjoy!</h4><p>Everything should now be ready and <strong>your contributors will be very happy</strong> with their preview applications. <strong>You will also be very happy</strong> with them because they will let you <strong>test new contributed features in seconds</strong> without having to checkout and build code locally!</p><p>Those preview applications are public meaning you can send their URLs to friends and other people to gather feedback. They won’t have to setup anything.</p><h4>But…</h4><p>Unfortunately, this solution is <strong>not perfect</strong>, it has some cons:</p><ul><li>It will <strong>only work for static websites/applications</strong>,</li><li><strong>Surge.sh won’t comment on merge requests</strong> once the previews are deployed: contributors will have to manually check the build logs to get their URL,</li><li><strong>Previews won’t be auto-destroyed once the branches are merged</strong>: you will have to manually tear them down. Surge CLI has a command to do that:</li></ul><pre>surge teardown my-awesome-project-new-feature.surge.sh</pre><p>Hope this will be useful for some of you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b861d7c9a3a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jubianchi-fr/preview-your-website-with-gitlab-ci-and-surge-5b861d7c9a3a">Preview your website with Gitlab CI and Surge</a> was originally published in <a href="https://medium.com/jubianchi-fr">jubianchi.fr</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>